Pārlūkot izejas kodu

Fix unit tests CRUDController

Florent Denis 11 gadi atpakaļ
vecāks
revīzija
048fde9d0b
1 mainītis faili ar 16 papildinājumiem un 0 dzēšanām
  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();