public function Framework_MockObjectTest::testObjectMethodCallWithArgumentCloningDisabled in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/phpunit/phpunit-mock-objects/tests/MockObjectTest.php \Framework_MockObjectTest::testObjectMethodCallWithArgumentCloningDisabled()
File
- vendor/
phpunit/ phpunit-mock-objects/ tests/ MockObjectTest.php, line 489
Class
- Framework_MockObjectTest
- @since Class available since Release 3.0.0
Code
public function testObjectMethodCallWithArgumentCloningDisabled() {
$expectedObject = new StdClass();
$mock = $this
->getMockBuilder('SomeClass')
->setMethods(array(
'doSomethingElse',
))
->disableArgumentCloning()
->getMock();
$actualArguments = array();
$mock
->expects($this
->any())
->method('doSomethingElse')
->will($this
->returnCallback(function () use (&$actualArguments) {
$actualArguments = func_get_args();
}));
$mock
->doSomethingElse($expectedObject);
$this
->assertEquals(1, count($actualArguments));
$this
->assertSame($expectedObject, $actualArguments[0]);
}