Skip to content

Commit d31898e

Browse files
committed
Just use the polyfill all the time
1 parent a9eae67 commit d31898e

File tree

1 file changed

+19
-25
lines changed

1 file changed

+19
-25
lines changed

tests/PolyfillTrait.php

Lines changed: 19 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -9,34 +9,28 @@
99

1010
namespace JsonSchema\Tests;
1111

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)
1920
{
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);
3625
}
3726
}
38-
} else {
39-
trait PolyfillTrait
27+
28+
public static function assertIsArray($actual, $message = '')
4029
{
30+
if (\is_callable(array('PHPUnit\Framework\TestCase', 'assertIsArray'))) {
31+
parent::assertIsArray($actual, $message);
32+
} else {
33+
static::assertInternalType('array', $actual, $message);
34+
}
4135
}
4236
}

0 commit comments

Comments
 (0)