Hi! > nope, some mock frameworks do that (afair atoum for example) but > phpunit(phpunit-mock-objects to be more precise) was using the serialize > trick and newInstanceWithoutConstructor() > (https://github.com/sebastianbergmann/phpunit-mock-objects/blob/42f29d650744fd7ce785e7a4dd3598a09b0bfd2b/src/Framework/MockObject/Generator.php#L273),
It does that too. But at least in version 3 it was also generating and eval'ing classes, in PHPUnit_Framework_MockObject_Generator. Looking here: https://github.com/sebastianbergmann/phpunit-mock-objects/tree/master/src/Framework/MockObject It is still doing class generation and evals. Not sure why it doesn't also override the ctor, maybe it was for some implementation consideration. -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php