|
@@ -390,6 +390,14 @@ class HelperControllerTest extends PHPUnit_Framework_TestCase
|
|
|
{
|
|
|
$object = new AdminControllerHelper_Foo();
|
|
|
|
|
|
+ $request = new Request(array(
|
|
|
+ 'code' => 'sonata.post.admin',
|
|
|
+ 'objectId' => 42,
|
|
|
+ 'field' => 'enabled',
|
|
|
+ 'value' => 1,
|
|
|
+ 'context' => 'list',
|
|
|
+ ), array(), array(), array(), array(), array('REQUEST_METHOD' => 'POST'));
|
|
|
+
|
|
|
$modelManager = $this->createMock('Sonata\AdminBundle\Model\ModelManagerInterface');
|
|
|
$modelManager->expects($this->once())->method('find')->will($this->returnValue($object));
|
|
|
|
|
@@ -400,6 +408,15 @@ class HelperControllerTest extends PHPUnit_Framework_TestCase
|
|
|
$mockForm = $this->getMockBuilder('Symfony\Component\Form\Form')
|
|
|
->disableOriginalConstructor()
|
|
|
->getMock();
|
|
|
+
|
|
|
+ $mockForm->expects($this->once())
|
|
|
+ ->method('setData')
|
|
|
+ ->with($object);
|
|
|
+
|
|
|
+ $mockForm->expects($this->once())
|
|
|
+ ->method('handleRequest')
|
|
|
+ ->with($request);
|
|
|
+
|
|
|
$mockForm->expects($this->once())
|
|
|
->method('createView')
|
|
|
->will($this->returnValue($mockView));
|
|
@@ -438,13 +455,6 @@ class HelperControllerTest extends PHPUnit_Framework_TestCase
|
|
|
|
|
|
$twig->addRuntimeLoader($runtimeLoader);
|
|
|
}
|
|
|
- $request = new Request(array(
|
|
|
- 'code' => 'sonata.post.admin',
|
|
|
- 'objectId' => 42,
|
|
|
- 'field' => 'enabled',
|
|
|
- 'value' => 1,
|
|
|
- 'context' => 'list',
|
|
|
- ), array(), array(), array(), array(), array('REQUEST_METHOD' => 'POST'));
|
|
|
|
|
|
$pool = new Pool($container, 'title', 'logo');
|
|
|
$pool->setAdminServiceIds(array('sonata.post.admin'));
|