|
@@ -226,13 +226,11 @@ class ExplainAdminCommandTest extends \PHPUnit_Framework_TestCase
|
|
|
->method('getModelManager')
|
|
|
->will($this->returnValue($modelManager));
|
|
|
|
|
|
- // @todo Mock of \Traversable is available since Phpunit 3.8. This should be completed after stable release of Phpunit 3.8.
|
|
|
- // @see https://github.com/sebastianbergmann/phpunit-mock-objects/issues/103
|
|
|
- // $formBuilder = $this->getMock('Symfony\Component\Form\FormBuilderInterface');
|
|
|
- //
|
|
|
- // $this->admin->expects($this->any())
|
|
|
- // ->method('getFormBuilder')
|
|
|
- // ->will($this->returnValue($formBuilder));
|
|
|
+ $formBuilder = $this->getMock('Symfony\Component\Form\FormBuilderInterface');
|
|
|
+
|
|
|
+ $this->admin->expects($this->any())
|
|
|
+ ->method('getFormBuilder')
|
|
|
+ ->will($this->returnValue($formBuilder));
|
|
|
|
|
|
$datagridBuilder = $this->getMock('\Sonata\AdminBundle\Builder\DatagridBuilderInterface');
|
|
|
|
|
@@ -254,6 +252,7 @@ class ExplainAdminCommandTest extends \PHPUnit_Framework_TestCase
|
|
|
str_replace("\n", PHP_EOL, file_get_contents(__DIR__.'/../Fixtures/Command/explain_admin.txt')),
|
|
|
get_class($this->admin),
|
|
|
get_class($modelManager),
|
|
|
+ get_class($formBuilder),
|
|
|
get_class($datagridBuilder),
|
|
|
get_class($listBuilder)
|
|
|
), $commandTester->getDisplay());
|
|
@@ -281,13 +280,11 @@ class ExplainAdminCommandTest extends \PHPUnit_Framework_TestCase
|
|
|
->method('getModelManager')
|
|
|
->will($this->returnValue($modelManager));
|
|
|
|
|
|
- // @todo Mock of \Traversable is available since Phpunit 3.8. This should be completed after stable release of Phpunit 3.8.
|
|
|
- // @see https://github.com/sebastianbergmann/phpunit-mock-objects/issues/103
|
|
|
- // $formBuilder = $this->getMock('Symfony\Component\Form\FormBuilderInterface');
|
|
|
- //
|
|
|
- // $this->admin->expects($this->any())
|
|
|
- // ->method('getFormBuilder')
|
|
|
- // ->will($this->returnValue($formBuilder));
|
|
|
+ $formBuilder = $this->getMock('Symfony\Component\Form\FormBuilderInterface');
|
|
|
+
|
|
|
+ $this->admin->expects($this->any())
|
|
|
+ ->method('getFormBuilder')
|
|
|
+ ->will($this->returnValue($formBuilder));
|
|
|
|
|
|
$datagridBuilder = $this->getMock('\Sonata\AdminBundle\Builder\DatagridBuilderInterface');
|
|
|
|
|
@@ -313,6 +310,7 @@ class ExplainAdminCommandTest extends \PHPUnit_Framework_TestCase
|
|
|
),
|
|
|
get_class($this->admin),
|
|
|
get_class($modelManager),
|
|
|
+ get_class($formBuilder),
|
|
|
get_class($datagridBuilder),
|
|
|
get_class($listBuilder)
|
|
|
), $commandTester->getDisplay());
|