|
9 | 9 |
|
10 | 10 | namespace JsonSchema\Tests;
|
11 | 11 |
|
12 |
| -if (version_compare(\PHPUnit\Runner\Version::id(), '6.0.0') < 0) { |
13 |
| - /** |
14 |
| - * Inspired by https://github.com/PHPUnitGoodPractices/polyfill |
15 |
| - * |
16 |
| - * @license MIT |
17 |
| - */ |
18 |
| - trait PolyfillTrait |
| 12 | +/** |
| 13 | + * Inspired by https://github.com/PHPUnitGoodPractices/polyfill |
| 14 | + * |
| 15 | + * @license MIT |
| 16 | + */ |
| 17 | +trait PolyfillTrait |
| 18 | +{ |
| 19 | + public function expectException($exception) |
19 | 20 | {
|
20 |
| - public function expectException($exception) |
21 |
| - { |
22 |
| - if (\is_callable(array(parent::class, 'expectException'))) { |
23 |
| - parent::expectException($exception); |
24 |
| - } else { |
25 |
| - $this->setExpectedException($exception); |
26 |
| - } |
27 |
| - } |
28 |
| - |
29 |
| - public static function assertIsArray($actual, $message = '') |
30 |
| - { |
31 |
| - if (\is_callable(array(parent::class, 'assertIsArray'))) { |
32 |
| - parent::assertIsArray($actual, $message); |
33 |
| - } else { |
34 |
| - static::assertInternalType('array', $actual, $message); |
35 |
| - } |
| 21 | + if (\is_callable(array('PHPUnit\Framework\TestCase', 'expectException'))) { |
| 22 | + parent::expectException($exception); |
| 23 | + } else { |
| 24 | + $this->setExpectedException($exception); |
36 | 25 | }
|
37 | 26 | }
|
38 |
| -} else { |
39 |
| - trait PolyfillTrait |
| 27 | + |
| 28 | + public static function assertIsArray($actual, $message = '') |
40 | 29 | {
|
| 30 | + if (\is_callable(array('PHPUnit\Framework\TestCase', 'assertIsArray'))) { |
| 31 | + parent::assertIsArray($actual, $message); |
| 32 | + } else { |
| 33 | + static::assertInternalType('array', $actual, $message); |
| 34 | + } |
41 | 35 | }
|
42 | 36 | }
|
0 commit comments