Преглед на файлове

Fix unit tests CRUDController

Florent Denis преди 11 години
родител
ревизия
048fde9d0b
променени са 1 файла, в които са добавени 16 реда и са изтрити 0 реда
  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();