public function Framework_MockObjectTest::testStubbedReturnArgument in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/phpunit/phpunit-mock-objects/tests/MockObjectTest.php \Framework_MockObjectTest::testStubbedReturnArgument()
File
- vendor/
phpunit/ phpunit-mock-objects/ tests/ MockObjectTest.php, line 211
Class
- Framework_MockObjectTest
- @since Class available since Release 3.0.0
Code
public function testStubbedReturnArgument() {
$mock = $this
->getMock('AnInterface');
$mock
->expects($this
->any())
->method('doSomething')
->will($this
->returnArgument(1));
$this
->assertEquals('b', $mock
->doSomething('a', 'b'));
$mock = $this
->getMock('AnInterface');
$mock
->expects($this
->any())
->method('doSomething')
->willReturnArgument(1);
$this
->assertEquals('b', $mock
->doSomething('a', 'b'));
}