Explorar o código

Fix unit tests

Thomas Rabaix %!s(int64=10) %!d(string=hai) anos
pai
achega
9c4457918c
Modificáronse 1 ficheiros con 32 adicións e 0 borrados
  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'))
             ->will($this->returnValue(true));
 
+        $this->admin->expects($this->any())
+            ->method('getClass')
+            ->will($this->returnValue('stdClass'));
+
         $this->assertLoggerLogsModelManagerException($this->admin, 'delete');
 
         $this->request->setMethod('DELETE');
@@ -1568,6 +1572,10 @@ class CRUDControllerTest extends \PHPUnit_Framework_TestCase
 
         $object = new \stdClass();
 
+        $this->admin->expects($this->any())
+            ->method('getClass')
+            ->will($this->returnValue('stdClass'));
+
         $this->admin->expects($this->once())
             ->method('getNewInstance')
             ->will($this->returnValue($object));
@@ -1633,6 +1641,10 @@ class CRUDControllerTest extends \PHPUnit_Framework_TestCase
             ->disableOriginalConstructor()
             ->getMock();
 
+        $this->admin->expects($this->any())
+            ->method('getClass')
+            ->will($this->returnValue('stdClass'));
+
         $this->admin->expects($this->once())
             ->method('getForm')
             ->will($this->returnValue($form));
@@ -1684,6 +1696,10 @@ class CRUDControllerTest extends \PHPUnit_Framework_TestCase
             ->disableOriginalConstructor()
             ->getMock();
 
+        $this->admin->expects($this->any())
+            ->method('getClass')
+            ->will($this->returnValue('stdClass'));
+
         $this->admin->expects($this->once())
             ->method('getForm')
             ->will($this->returnValue($form));
@@ -1709,6 +1725,10 @@ class CRUDControllerTest extends \PHPUnit_Framework_TestCase
 
         $object = new \stdClass();
 
+        $this->admin->expects($this->any())
+            ->method('getClass')
+            ->will($this->returnValue('stdClass'));
+
         $this->admin->expects($this->once())
             ->method('getNewInstance')
             ->will($this->returnValue($object));
@@ -1792,6 +1812,10 @@ class CRUDControllerTest extends \PHPUnit_Framework_TestCase
             ->method('isValid')
             ->will($this->returnValue(true));
 
+        $this->admin->expects($this->any())
+            ->method('getClass')
+            ->will($this->returnValue('stdClass'));
+
         $this->admin->expects($this->once())
             ->method('getNormalizedIdentifier')
             ->with($this->equalTo($object))
@@ -1824,6 +1848,10 @@ class CRUDControllerTest extends \PHPUnit_Framework_TestCase
             ->disableOriginalConstructor()
             ->getMock();
 
+        $this->admin->expects($this->any())
+            ->method('getClass')
+            ->will($this->returnValue('stdClass'));
+
         $this->admin->expects($this->once())
             ->method('getForm')
             ->will($this->returnValue($form));
@@ -1872,6 +1900,10 @@ class CRUDControllerTest extends \PHPUnit_Framework_TestCase
             ->disableOriginalConstructor()
             ->getMock();
 
+        $this->admin->expects($this->any())
+            ->method('getClass')
+            ->will($this->returnValue('stdClass'));
+
         $this->admin->expects($this->once())
             ->method('getForm')
             ->will($this->returnValue($form));