Mercurial > hg > isophonics-drupal-site
comparison vendor/phpunit/phpunit-mock-objects/tests/ProxyObjectTest.php @ 14:1fec387a4317
Update Drupal core to 8.5.2 via Composer
author | Chris Cannam |
---|---|
date | Mon, 23 Apr 2018 09:46:53 +0100 |
parents | 4c8ae668cc8c |
children |
comparison
equal
deleted
inserted
replaced
13:5fb285c0d0e3 | 14:1fec387a4317 |
---|---|
1 <?php | 1 <?php |
2 /* | 2 /* |
3 * This file is part of the PHPUnit_MockObject package. | 3 * This file is part of the phpunit-mock-objects package. |
4 * | 4 * |
5 * (c) Sebastian Bergmann <sebastian@phpunit.de> | 5 * (c) Sebastian Bergmann <sebastian@phpunit.de> |
6 * | 6 * |
7 * For the full copyright and license information, please view the LICENSE | 7 * For the full copyright and license information, please view the LICENSE |
8 * file that was distributed with this source code. | 8 * file that was distributed with this source code. |
9 */ | 9 */ |
10 | 10 |
11 /** | 11 use PHPUnit\Framework\TestCase; |
12 * @since Class available since Release 2.0.0 | 12 |
13 */ | 13 class ProxyObjectTest extends TestCase |
14 class Framework_ProxyObjectTest extends PHPUnit_Framework_TestCase | |
15 { | 14 { |
16 public function testMockedMethodIsProxiedToOriginalMethod() | 15 public function testMockedMethodIsProxiedToOriginalMethod() |
17 { | 16 { |
18 $proxy = $this->getMockBuilder('Bar') | 17 $proxy = $this->getMockBuilder(Bar::class) |
19 ->enableProxyingToOriginalMethods() | 18 ->enableProxyingToOriginalMethods() |
20 ->getMock(); | 19 ->getMock(); |
21 | 20 |
22 $proxy->expects($this->once()) | 21 $proxy->expects($this->once()) |
23 ->method('doSomethingElse'); | 22 ->method('doSomethingElse'); |
24 | 23 |
25 $foo = new Foo; | 24 $foo = new Foo; |
25 | |
26 $this->assertEquals('result', $foo->doSomething($proxy)); | 26 $this->assertEquals('result', $foo->doSomething($proxy)); |
27 } | 27 } |
28 | 28 |
29 public function testMockedMethodWithReferenceIsProxiedToOriginalMethod() | 29 public function testMockedMethodWithReferenceIsProxiedToOriginalMethod() |
30 { | 30 { |
31 $proxy = $this->getMockBuilder('MethodCallbackByReference') | 31 $proxy = $this->getMockBuilder(MethodCallbackByReference::class) |
32 ->enableProxyingToOriginalMethods() | 32 ->enableProxyingToOriginalMethods() |
33 ->getMock(); | 33 ->getMock(); |
34 | |
34 $a = $b = $c = 0; | 35 $a = $b = $c = 0; |
35 | 36 |
36 $proxy->callback($a, $b, $c); | 37 $proxy->callback($a, $b, $c); |
37 | 38 |
38 $this->assertEquals(1, $b); | 39 $this->assertEquals(1, $b); |