Changeset 1290

Show
Ignore:
Timestamp:
01/23/08 21:20:57 (9 months ago)
Author:
mikey
Message:

PHPUnit patch: $callOriginalConstructor and $callOriginalClone have to be taken into account

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/experiments/general/PHPUnit/phpunit_mock.patch

    r1289 r1290  
    2828-          $callAutoload 
    2929-        ); 
    30 +        $key = md5($className . serialize($methods)); 
     30+        $key = md5($className . serialize($methods) . serialize($callOriginalConstructor) . serialize($callOriginalClone)); 
    3131+        if (isset(self::$mockClasses[$key]) === false || empty($mockClassName) === false) { 
    3232+            $mock = PHPUnit_Framework_MockObject_Mock::generate( 
     
    155155  * @license    http://www.opensource.org/licenses/bsd-license.php  BSD License 
    156156  * @version    Release: @package_version@ 
    157 @@ -145,5 +147,54 @@ 
     157@@ -145,5 +147,68 @@ 
    158158  
    159159         $this->assertEquals('something', $mock->doSomething()); 
     
    208208+        $mock2 = $this->getMock('PartialMockTestClass', array(), array(), __FUNCTION__); 
    209209+    } 
     210+ 
     211+    public function testOriginalConstructorSettingConsidered() 
     212+    { 
     213+        $mock1 = $this->getMock('PartialMockTestClass'); 
     214+        $mock2 = $this->getMock('PartialMockTestClass', array(), array(), '', FALSE); 
     215+        $this->assertNotEquals(get_class($mock1), get_class($mock2)); 
     216+    } 
     217+ 
     218+    public function testOriginalCloneSettingConsidered() 
     219+    { 
     220+        $mock1 = $this->getMock('PartialMockTestClass'); 
     221+        $mock2 = $this->getMock('PartialMockTestClass', array(), array(), '', TRUE, FALSE); 
     222+        $this->assertNotEquals(get_class($mock1), get_class($mock2)); 
     223+    } 
    210224 } 
    211225 ?>