Skip to content

Commit

Permalink
Adapt to new cs fixer rules
Browse files Browse the repository at this point in the history
  • Loading branch information
greg0ire committed May 6, 2019
1 parent 7e54171 commit 9af9b39
Show file tree
Hide file tree
Showing 56 changed files with 1,027 additions and 1,027 deletions.
16 changes: 8 additions & 8 deletions tests/Action/DashboardActionTest.php
Expand Up @@ -61,15 +61,15 @@ public function testdashboardActionStandardRequest()
];
$dashboardAction->setContainer($container);

$container->expects($this->any())->method('get')->will($this->returnCallback(static function ($id) use ($values) {
$container->expects($this->any())->method('get')->willReturnCallback(static function ($id) use ($values) {
return $values[$id];
}));
});

$container->expects($this->any())
->method('has')
->will($this->returnCallback(static function ($id) {
->willReturnCallback(static function ($id) {
return 'templating' === $id;
}));
});

$this->isInstanceOf(Response::class, $dashboardAction($request));
}
Expand Down Expand Up @@ -110,15 +110,15 @@ public function testDashboardActionAjaxLayout(): void
];
$dashboardAction->setContainer($container);

$container->expects($this->any())->method('get')->will($this->returnCallback(static function ($id) use ($values) {
$container->expects($this->any())->method('get')->willReturnCallback(static function ($id) use ($values) {
return $values[$id];
}));
});

$container->expects($this->any())
->method('has')
->will($this->returnCallback(static function ($id) {
->willReturnCallback(static function ($id) {
return 'templating' === $id;
}));
});

$this->isInstanceOf(Response::class, $dashboardAction($request));
}
Expand Down
40 changes: 20 additions & 20 deletions tests/Admin/AdminHelperTest.php
Expand Up @@ -68,11 +68,11 @@ public function testGetChildFormView(): void
public function testAddNewInstance(): void
{
$admin = $this->createMock(AdminInterface::class);
$admin->expects($this->once())->method('getNewInstance')->will($this->returnValue(new \stdClass()));
$admin->expects($this->once())->method('getNewInstance')->willReturn(new \stdClass());

$fieldDescription = $this->createMock(FieldDescriptionInterface::class);
$fieldDescription->expects($this->once())->method('getAssociationAdmin')->will($this->returnValue($admin));
$fieldDescription->expects($this->once())->method('getAssociationMapping')->will($this->returnValue(['fieldName' => 'fooBar']));
$fieldDescription->expects($this->once())->method('getAssociationAdmin')->willReturn($admin);
$fieldDescription->expects($this->once())->method('getAssociationMapping')->willReturn(['fieldName' => 'fooBar']);

$object = $this->getMockBuilder('stdClass')
->setMethods(['addFooBar'])
Expand All @@ -85,11 +85,11 @@ public function testAddNewInstance(): void
public function testAddNewInstancePlural(): void
{
$admin = $this->createMock(AdminInterface::class);
$admin->expects($this->once())->method('getNewInstance')->will($this->returnValue(new \stdClass()));
$admin->expects($this->once())->method('getNewInstance')->willReturn(new \stdClass());

$fieldDescription = $this->createMock(FieldDescriptionInterface::class);
$fieldDescription->expects($this->once())->method('getAssociationAdmin')->will($this->returnValue($admin));
$fieldDescription->expects($this->once())->method('getAssociationMapping')->will($this->returnValue(['fieldName' => 'fooBars']));
$fieldDescription->expects($this->once())->method('getAssociationAdmin')->willReturn($admin);
$fieldDescription->expects($this->once())->method('getAssociationMapping')->willReturn(['fieldName' => 'fooBars']);

$object = $this->getMockBuilder('stdClass')
->setMethods(['addFooBar'])
Expand All @@ -102,11 +102,11 @@ public function testAddNewInstancePlural(): void
public function testAddNewInstanceInflector(): void
{
$admin = $this->createMock(AdminInterface::class);
$admin->expects($this->once())->method('getNewInstance')->will($this->returnValue(new \stdClass()));
$admin->expects($this->once())->method('getNewInstance')->willReturn(new \stdClass());

$fieldDescription = $this->createMock(FieldDescriptionInterface::class);
$fieldDescription->expects($this->once())->method('getAssociationAdmin')->will($this->returnValue($admin));
$fieldDescription->expects($this->once())->method('getAssociationMapping')->will($this->returnValue(['fieldName' => 'entries']));
$fieldDescription->expects($this->once())->method('getAssociationAdmin')->willReturn($admin);
$fieldDescription->expects($this->once())->method('getAssociationMapping')->willReturn(['fieldName' => 'entries']);

$object = $this->getMockBuilder('stdClass')
->setMethods(['addEntry'])
Expand All @@ -128,9 +128,9 @@ public function testGetElementAccessPath(): void
->setMethods(['getMoreThings'])
->getMock();

$object->expects($this->atLeastOnce())->method('getPathToObject')->will($this->returnValue([$subObject]));
$subObject->expects($this->atLeastOnce())->method('getAnother')->will($this->returnValue($sub2Object));
$sub2Object->expects($this->atLeastOnce())->method('getMoreThings')->will($this->returnValue('Value'));
$object->expects($this->atLeastOnce())->method('getPathToObject')->willReturn([$subObject]);
$subObject->expects($this->atLeastOnce())->method('getAnother')->willReturn($sub2Object);
$sub2Object->expects($this->atLeastOnce())->method('getMoreThings')->willReturn('Value');

$path = $this->helper->getElementAccessPath('uniquePartOfId_path_to_object_0_another_more_things', $object);

Expand All @@ -147,8 +147,8 @@ public function testItThrowsExceptionWhenDoesNotFindTheFullPath(): void
->setMethods(['getMore'])
->getMock();

$object->expects($this->atLeastOnce())->method('getPathToObject')->will($this->returnValue([$subObject]));
$subObject->expects($this->atLeastOnce())->method('getMore')->will($this->returnValue('Value'));
$object->expects($this->atLeastOnce())->method('getPathToObject')->willReturn([$subObject]);
$subObject->expects($this->atLeastOnce())->method('getMore')->willReturn('Value');

$this->expectException(\Exception::class, 'Could not get element id from '.$path.' Failing part: calls');

Expand Down Expand Up @@ -179,17 +179,17 @@ public function testAppendFormFieldElementNested(): void
$formBuilder = new FormBuilder('test', \get_class($simpleObject), $eventDispatcher, $formFactory);
$childFormBuilder = new FormBuilder('subObject', \get_class($subObject), $eventDispatcher, $formFactory);

$object->expects($this->atLeastOnce())->method('getSubObject')->will($this->returnValue([$subObject]));
$subObject->expects($this->atLeastOnce())->method('getAnd')->will($this->returnValue($sub2Object));
$sub2Object->expects($this->atLeastOnce())->method('getMore')->will($this->returnValue([$sub3Object]));
$sub3Object->expects($this->atLeastOnce())->method('getFinalData')->will($this->returnValue('value'));
$object->expects($this->atLeastOnce())->method('getSubObject')->willReturn([$subObject]);
$subObject->expects($this->atLeastOnce())->method('getAnd')->willReturn($sub2Object);
$sub2Object->expects($this->atLeastOnce())->method('getMore')->willReturn([$sub3Object]);
$sub3Object->expects($this->atLeastOnce())->method('getFinalData')->willReturn('value');

$formBuilder->setCompound(true);
$formBuilder->setDataMapper($dataMapper);
$formBuilder->add($childFormBuilder);

$admin->expects($this->once())->method('getFormBuilder')->will($this->returnValue($formBuilder));
$admin->expects($this->once())->method('getSubject')->will($this->returnValue($object));
$admin->expects($this->once())->method('getFormBuilder')->willReturn($formBuilder);
$admin->expects($this->once())->method('getSubject')->willReturn($object);

$this->expectException(\Exception::class, 'unknown collection class');

Expand Down

0 comments on commit 9af9b39

Please sign in to comment.