Jelajahi Sumber

Fix unit tests

Thomas Rabaix 10 tahun lalu
induk
melakukan
9c4457918c
1 mengubah file dengan 32 tambahan dan 0 penghapusan
  1. 32 0
      Tests/Controller/CRUDControllerTest.php

+ 32 - 0
Tests/Controller/CRUDControllerTest.php

@@ -991,6 +991,10 @@ class CRUDControllerTest extends \PHPUnit_Framework_TestCase
             ->with($this->equalTo('DELETE'))
             ->with($this->equalTo('DELETE'))
             ->will($this->returnValue(true));
             ->will($this->returnValue(true));
 
 
+        $this->admin->expects($this->any())
+            ->method('getClass')
+            ->will($this->returnValue('stdClass'));
+
         $this->assertLoggerLogsModelManagerException($this->admin, 'delete');
         $this->assertLoggerLogsModelManagerException($this->admin, 'delete');
 
 
         $this->request->setMethod('DELETE');
         $this->request->setMethod('DELETE');
@@ -1568,6 +1572,10 @@ class CRUDControllerTest extends \PHPUnit_Framework_TestCase
 
 
         $object = new \stdClass();
         $object = new \stdClass();
 
 
+        $this->admin->expects($this->any())
+            ->method('getClass')
+            ->will($this->returnValue('stdClass'));
+
         $this->admin->expects($this->once())
         $this->admin->expects($this->once())
             ->method('getNewInstance')
             ->method('getNewInstance')
             ->will($this->returnValue($object));
             ->will($this->returnValue($object));
@@ -1633,6 +1641,10 @@ class CRUDControllerTest extends \PHPUnit_Framework_TestCase
             ->disableOriginalConstructor()
             ->disableOriginalConstructor()
             ->getMock();
             ->getMock();
 
 
+        $this->admin->expects($this->any())
+            ->method('getClass')
+            ->will($this->returnValue('stdClass'));
+
         $this->admin->expects($this->once())
         $this->admin->expects($this->once())
             ->method('getForm')
             ->method('getForm')
             ->will($this->returnValue($form));
             ->will($this->returnValue($form));
@@ -1684,6 +1696,10 @@ class CRUDControllerTest extends \PHPUnit_Framework_TestCase
             ->disableOriginalConstructor()
             ->disableOriginalConstructor()
             ->getMock();
             ->getMock();
 
 
+        $this->admin->expects($this->any())
+            ->method('getClass')
+            ->will($this->returnValue('stdClass'));
+
         $this->admin->expects($this->once())
         $this->admin->expects($this->once())
             ->method('getForm')
             ->method('getForm')
             ->will($this->returnValue($form));
             ->will($this->returnValue($form));
@@ -1709,6 +1725,10 @@ class CRUDControllerTest extends \PHPUnit_Framework_TestCase
 
 
         $object = new \stdClass();
         $object = new \stdClass();
 
 
+        $this->admin->expects($this->any())
+            ->method('getClass')
+            ->will($this->returnValue('stdClass'));
+
         $this->admin->expects($this->once())
         $this->admin->expects($this->once())
             ->method('getNewInstance')
             ->method('getNewInstance')
             ->will($this->returnValue($object));
             ->will($this->returnValue($object));
@@ -1792,6 +1812,10 @@ class CRUDControllerTest extends \PHPUnit_Framework_TestCase
             ->method('isValid')
             ->method('isValid')
             ->will($this->returnValue(true));
             ->will($this->returnValue(true));
 
 
+        $this->admin->expects($this->any())
+            ->method('getClass')
+            ->will($this->returnValue('stdClass'));
+
         $this->admin->expects($this->once())
         $this->admin->expects($this->once())
             ->method('getNormalizedIdentifier')
             ->method('getNormalizedIdentifier')
             ->with($this->equalTo($object))
             ->with($this->equalTo($object))
@@ -1824,6 +1848,10 @@ class CRUDControllerTest extends \PHPUnit_Framework_TestCase
             ->disableOriginalConstructor()
             ->disableOriginalConstructor()
             ->getMock();
             ->getMock();
 
 
+        $this->admin->expects($this->any())
+            ->method('getClass')
+            ->will($this->returnValue('stdClass'));
+
         $this->admin->expects($this->once())
         $this->admin->expects($this->once())
             ->method('getForm')
             ->method('getForm')
             ->will($this->returnValue($form));
             ->will($this->returnValue($form));
@@ -1872,6 +1900,10 @@ class CRUDControllerTest extends \PHPUnit_Framework_TestCase
             ->disableOriginalConstructor()
             ->disableOriginalConstructor()
             ->getMock();
             ->getMock();
 
 
+        $this->admin->expects($this->any())
+            ->method('getClass')
+            ->will($this->returnValue('stdClass'));
+
         $this->admin->expects($this->once())
         $this->admin->expects($this->once())
             ->method('getForm')
             ->method('getForm')
             ->will($this->returnValue($form));
             ->will($this->returnValue($form));