Changeset 1290
- Timestamp:
- 01/23/08 21:20:57 (9 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/experiments/general/PHPUnit/phpunit_mock.patch
r1289 r1290 28 28 - $callAutoload 29 29 - ); 30 + $key = md5($className . serialize($methods) );30 + $key = md5($className . serialize($methods) . serialize($callOriginalConstructor) . serialize($callOriginalClone)); 31 31 + if (isset(self::$mockClasses[$key]) === false || empty($mockClassName) === false) { 32 32 + $mock = PHPUnit_Framework_MockObject_Mock::generate( … … 155 155 * @license http://www.opensource.org/licenses/bsd-license.php BSD License 156 156 * @version Release: @package_version@ 157 @@ -145,5 +147, 54@@157 @@ -145,5 +147,68 @@ 158 158 159 159 $this->assertEquals('something', $mock->doSomething()); … … 208 208 + $mock2 = $this->getMock('PartialMockTestClass', array(), array(), __FUNCTION__); 209 209 + } 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 + } 210 224 } 211 225 ?>
