public function Framework_MockObject_GeneratorTest::testGetMockForSingletonWithUnserializeFail in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/phpunit/phpunit-mock-objects/tests/GeneratorTest.php \Framework_MockObject_GeneratorTest::testGetMockForSingletonWithUnserializeFail()
Same as "testGetMockForSingletonWithReflectionSuccess", but we expect warning for PHP < 5.4.0 since PHPUnit will try to execute private __wakeup on unserialize
File
- vendor/
phpunit/ phpunit-mock-objects/ tests/ GeneratorTest.php, line 173
Class
Code
public function testGetMockForSingletonWithUnserializeFail() {
if (version_compare(PHP_VERSION, '5.4.0', '>=')) {
$this
->markTestSkipped('Only for PHP < 5.4.0');
}
$this
->setExpectedException('PHPUnit_Framework_MockObject_RuntimeException');
// Probably, this should be moved to tests/autoload.php
require_once __DIR__ . '/_fixture/SingletonClass.php';
$mock = $this->generator
->getMock('SingletonClass', array(
'doSomething',
), array(), '', false);
}