Skip to content

Commit 8436a48

Browse files
committed
We have to use PolyfillTrait
1 parent f21197f commit 8436a48

9 files changed

+26
-1
lines changed

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@
3636
"json-schema/json-schema-test-suite": "1.2.0",
3737
"phpunit/phpunit": ">=4.8.36 <10",
3838
"sanmai/phpunit-legacy-adapter": "^6.4 || ^8.2.1",
39-
"phpspec/prophecy-phpunit": ">=1.0"
39+
"phpspec/prophecy-phpunit": ">=1.0",
40+
"phpunitgoodpractices/polyfill": "^1.6"
4041
},
4142
"extra": {
4243
"branch-alias": {

tests/ConstraintErrorTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,12 @@
1111

1212
use JsonSchema\ConstraintError;
1313
use LegacyPHPUnit\TestCase;
14+
use PHPUnitGoodPractices\Polyfill\PolyfillTrait;
1415

1516
class ConstraintErrorTest extends TestCase
1617
{
18+
use PolyfillTrait;
19+
1720
public function testGetValidMessage()
1821
{
1922
$e = ConstraintError::ALL_OF();

tests/Constraints/FactoryTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
use JsonSchema\Constraints\Factory;
1414
use JsonSchema\Entity\JsonPointer;
1515
use LegacyPHPUnit\TestCase;
16+
use PHPUnitGoodPractices\Polyfill\PolyfillTrait;
1617

1718
/**
1819
* Class MyBadConstraint
@@ -37,6 +38,8 @@ public function check(&$value, $schema = null, JsonPointer $path = null, $i = nu
3738

3839
class FactoryTest extends TestCase
3940
{
41+
use PolyfillTrait;
42+
4043
/**
4144
* @var Factory
4245
*/

tests/Constraints/SchemaValidationTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,12 @@
1212
use JsonSchema\Constraints\Constraint;
1313
use JsonSchema\Validator;
1414
use LegacyPHPUnit\TestCase;
15+
use PHPUnitGoodPractices\Polyfill\PolyfillTrait;
1516

1617
class SchemaValidationTest extends TestCase
1718
{
19+
use PolyfillTrait;
20+
1821
protected $validateSchema = true;
1922

2023
public function getInvalidTests()

tests/Constraints/SelfDefinedSchemaTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,12 @@
1010
namespace JsonSchema\Tests\Constraints;
1111

1212
use JsonSchema\Validator;
13+
use PHPUnitGoodPractices\Polyfill\PolyfillTrait;
1314

1415
class SelfDefinedSchemaTest extends BaseTestCase
1516
{
17+
use PolyfillTrait;
18+
1619
protected $validateSchema = true;
1720

1821
public function getInvalidTests()

tests/Constraints/TypeTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
use JsonSchema\Constraints\TypeCheck\LooseTypeCheck;
1313
use JsonSchema\Constraints\TypeConstraint;
1414
use LegacyPHPUnit\TestCase;
15+
use PHPUnitGoodPractices\Polyfill\PolyfillTrait;
1516

1617
/**
1718
* Class TypeTest
@@ -22,6 +23,8 @@
2223
*/
2324
class TypeTest extends TestCase
2425
{
26+
use PolyfillTrait;
27+
2528
/**
2629
* @see testIndefiniteArticleForTypeInTypeCheckErrorMessage
2730
*

tests/Constraints/ValidationExceptionTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,12 @@
1313
use JsonSchema\Exception\ValidationException;
1414
use JsonSchema\Validator;
1515
use LegacyPHPUnit\TestCase;
16+
use PHPUnitGoodPractices\Polyfill\PolyfillTrait;
1617

1718
class ValidationExceptionTest extends TestCase
1819
{
20+
use PolyfillTrait;
21+
1922
public function testValidationException()
2023
{
2124
$exception = new ValidationException();

tests/Entity/JsonPointerTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
use JsonSchema\Entity\JsonPointer;
1313
use LegacyPHPUnit\TestCase;
14+
use PHPUnitGoodPractices\Polyfill\PolyfillTrait;
1415

1516
/**
1617
* @package JsonSchema\Tests\Entity
@@ -19,6 +20,8 @@
1920
*/
2021
class JsonPointerTest extends TestCase
2122
{
23+
use PolyfillTrait;
24+
2225
/**
2326
* @dataProvider getTestData
2427
*

tests/RefTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,12 @@
1111

1212
use JsonSchema\Validator;
1313
use LegacyPHPUnit\TestCase;
14+
use PHPUnitGoodPractices\Polyfill\PolyfillTrait;
1415

1516
class RefTest extends TestCase
1617
{
18+
use PolyfillTrait;
19+
1720
public function dataRefIgnoresSiblings()
1821
{
1922
return array(

0 commit comments

Comments
 (0)