support different formats in user timesheet exports (#1222)
This commit is contained in:
@@ -21,7 +21,7 @@ class QueryBuilderPaginatorTest extends TestCase
|
||||
{
|
||||
public function testPaginator()
|
||||
{
|
||||
$em = $this->getMockBuilder(EntityManager::class)->disableOriginalConstructor()->getMock();
|
||||
$em = $this->createMock(EntityManager::class);
|
||||
$qb = new QueryBuilder($em);
|
||||
$sut = new QueryBuilderPaginator($qb, 10);
|
||||
|
||||
|
||||
@@ -68,14 +68,14 @@ class BaseQueryTest extends TestCase
|
||||
|
||||
private function getFormBuilder(string $name)
|
||||
{
|
||||
return new FormBuilder($name, null, new EventDispatcher(), $this->getMockBuilder(FormFactoryInterface::class)->getMock(), []);
|
||||
return new FormBuilder($name, null, new EventDispatcher(), $this->createMock(FormFactoryInterface::class), []);
|
||||
}
|
||||
|
||||
protected function resetByFormError(BaseQuery $sut, array $invalidFields)
|
||||
{
|
||||
$formBuilder = $this->getFormBuilder('form');
|
||||
$formBuilder->setCompound(true);
|
||||
$formBuilder->setDataMapper($this->getMockBuilder(DataMapperInterface::class)->getMock());
|
||||
$formBuilder->setDataMapper($this->createMock(DataMapperInterface::class));
|
||||
|
||||
$form = $formBuilder->getForm();
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ class WidgetRepositoryTest extends TestCase
|
||||
{
|
||||
public function testHasWidget()
|
||||
{
|
||||
$repoMock = $this->getMockBuilder(TimesheetRepository::class)->disableOriginalConstructor()->getMock();
|
||||
$repoMock = $this->createMock(TimesheetRepository::class);
|
||||
$userMock = (new CurrentUserFactory($this))->create(new User());
|
||||
|
||||
$sut = new WidgetRepository($repoMock, $userMock, ['test' => []]);
|
||||
@@ -38,7 +38,7 @@ class WidgetRepositoryTest extends TestCase
|
||||
$this->expectException(\InvalidArgumentException::class);
|
||||
$this->expectExceptionMessage('Cannot find widget "foo".');
|
||||
|
||||
$repoMock = $this->getMockBuilder(TimesheetRepository::class)->disableOriginalConstructor()->getMock();
|
||||
$repoMock = $this->createMock(TimesheetRepository::class);
|
||||
$userMock = (new CurrentUserFactory($this))->create(new User());
|
||||
|
||||
$sut = new WidgetRepository($repoMock, $userMock, ['test' => []]);
|
||||
@@ -50,7 +50,7 @@ class WidgetRepositoryTest extends TestCase
|
||||
$this->expectException(WidgetException::class);
|
||||
$this->expectExceptionMessage('Unknown widget type "FooBar"');
|
||||
|
||||
$repoMock = $this->getMockBuilder(TimesheetRepository::class)->disableOriginalConstructor()->getMock();
|
||||
$repoMock = $this->createMock(TimesheetRepository::class);
|
||||
$userMock = (new CurrentUserFactory($this))->create(new User());
|
||||
|
||||
$sut = new WidgetRepository($repoMock, $userMock, ['test' => ['type' => 'FooBar', 'user' => false]]);
|
||||
@@ -62,7 +62,7 @@ class WidgetRepositoryTest extends TestCase
|
||||
$this->expectException(WidgetException::class);
|
||||
$this->expectExceptionMessage('Widget type "App\Widget\Type\CompoundChart" is not an instance of "App\Widget\Type\AbstractWidgetType"');
|
||||
|
||||
$repoMock = $this->getMockBuilder(TimesheetRepository::class)->disableOriginalConstructor()->getMock();
|
||||
$repoMock = $this->createMock(TimesheetRepository::class);
|
||||
$userMock = (new CurrentUserFactory($this))->create(new User());
|
||||
|
||||
$sut = new WidgetRepository($repoMock, $userMock, ['test' => ['type' => CompoundChart::class, 'user' => false]]);
|
||||
@@ -74,7 +74,7 @@ class WidgetRepositoryTest extends TestCase
|
||||
*/
|
||||
public function testGetWidget($data, $query, $dataType)
|
||||
{
|
||||
$repoMock = $this->getMockBuilder(TimesheetRepository::class)->disableOriginalConstructor()->getMock();
|
||||
$repoMock = $this->createMock(TimesheetRepository::class);
|
||||
$repoMock->method('getStatistic')->willReturn($data);
|
||||
|
||||
$userMock = (new CurrentUserFactory($this))->create(new User());
|
||||
|
||||
Reference in New Issue
Block a user