Explorar el Código

Fix unit tests CRUDController

Florent Denis hace 11 años
padre
commit
048fde9d0b
Se han modificado 1 ficheros con 16 adiciones y 0 borrados
  1. 16 0
      Tests/Controller/CRUDControllerTest.php

+ 16 - 0
Tests/Controller/CRUDControllerTest.php

@@ -978,6 +978,10 @@ class CRUDControllerTest extends \PHPUnit_Framework_TestCase
             ->method('getObject')
             ->will($this->returnValue($object));
 
+        $this->admin->expects($this->once())
+            ->method('update')
+            ->will($this->returnArgument(0));
+
         $this->admin->expects($this->once())
             ->method('isGranted')
             ->with($this->equalTo('EDIT'))
@@ -1063,6 +1067,10 @@ class CRUDControllerTest extends \PHPUnit_Framework_TestCase
             ->method('getObject')
             ->will($this->returnValue($object));
 
+        $this->admin->expects($this->once())
+            ->method('update')
+            ->will($this->returnArgument(0));
+
         $this->admin->expects($this->once())
             ->method('isGranted')
             ->with($this->equalTo('EDIT'))
@@ -1261,6 +1269,10 @@ class CRUDControllerTest extends \PHPUnit_Framework_TestCase
             ->method('getNewInstance')
             ->will($this->returnValue($object));
 
+        $this->admin->expects($this->once())
+            ->method('create')
+            ->will($this->returnArgument(0));
+
         $form = $this->getMockBuilder('Symfony\Component\Form\Form')
             ->disableOriginalConstructor()
             ->getMock();
@@ -1346,6 +1358,10 @@ class CRUDControllerTest extends \PHPUnit_Framework_TestCase
             ->method('getNewInstance')
             ->will($this->returnValue($object));
 
+        $this->admin->expects($this->once())
+            ->method('create')
+            ->will($this->returnArgument(0));
+
         $form = $this->getMockBuilder('Symfony\Component\Form\Form')
             ->disableOriginalConstructor()
             ->getMock();