3 * This file is part of the PHPUnit_MockObject package.
5 * (c) Sebastian Bergmann <sebastian@phpunit.de>
7 * For the full copyright and license information, please view the LICENSE
8 * file that was distributed with this source code.
11 class Framework_ProxyObjectTest
extends PHPUnit_Framework_TestCase
13 public function testMockedMethodIsProxiedToOriginalMethod()
15 $proxy = $this->getMockBuilder(Bar
::class)
16 ->enableProxyingToOriginalMethods()
19 $proxy->expects($this->once())
20 ->method('doSomethingElse');
24 $this->assertEquals('result', $foo->doSomething($proxy));
27 public function testMockedMethodWithReferenceIsProxiedToOriginalMethod()
29 $proxy = $this->getMockBuilder(MethodCallbackByReference
::class)
30 ->enableProxyingToOriginalMethods()
35 $proxy->callback($a, $b, $c);
37 $this->assertEquals(1, $b);