Skip to content

Another attempt to make it work under PHP 5.3 and PHP 8+ #693

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 29 commits into from
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
ff33d72
Another attempt to make it work under PHP 5.3 and PHP 8+
sanmai Aug 31, 2022
ac97290
Use adapter instead
sanmai Aug 31, 2022
cc3d1cb
Use a different TestCase implementation
sanmai Aug 31, 2022
861deec
Renames, dependencies
sanmai Aug 31, 2022
5bb24e3
/getMock/createPartialMock/
sanmai Aug 31, 2022
80bb70e
expectException instead
sanmai Aug 31, 2022
43c49e7
Fix more tests
sanmai Sep 1, 2022
6530d3f
Fix remaining errors
sanmai Sep 1, 2022
ebc1243
Require PHPUnit <10
sanmai Sep 1, 2022
df08460
Swap dependencies
sanmai Sep 1, 2022
9fc4671
PHP 5.3 fix
sanmai Sep 1, 2022
f21197f
Bump PHPUnit a bit
sanmai Sep 1, 2022
8436a48
We have to use PolyfillTrait
sanmai Sep 1, 2022
01ec2c9
Use bundleted trait instead
sanmai Sep 1, 2022
a9eae67
Use vendored phpunit
sanmai Sep 1, 2022
d31898e
Just use the polyfill all the time
sanmai Sep 1, 2022
7f8b32f
Bummer, we still need to account for return void
sanmai Sep 1, 2022
ab4622d
Try with PHP 7.1 as lowest
sanmai Sep 1, 2022
52640e1
Revert "Try with PHP 7.1 as lowest"
sanmai Sep 1, 2022
44cc011
Revert "Bummer, we still need to account for return void"
sanmai Sep 1, 2022
c980858
Revert "Just use the polyfill all the time"
sanmai Sep 1, 2022
c52483b
Revert "Use bundleted trait instead"
sanmai Sep 1, 2022
872b34c
Revert "We have to use PolyfillTrait"
sanmai Sep 1, 2022
095ae91
Can't use traits in PHP 5.3
sanmai Sep 1, 2022
4350562
Use compat methods
sanmai Sep 1, 2022
7b74df3
8.1 + lowest-ignore can be built ever
sanmai Sep 1, 2022
4083f14
Use getMockCompat
sanmai Sep 1, 2022
3e00bdb
Make it private
sanmai Sep 1, 2022
f911163
CS
sanmai Sep 1, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- "7.2"
- "7.3"
- "7.4"
# - "8.0"
- "8.0"
dependencies: [highest]
experimental: [false]
include:
Expand All @@ -36,15 +36,15 @@ jobs:
- php-version: "5.3"
dependencies: lowest
experimental: false
# - php-version: "8.0"
# dependencies: highest
# experimental: false
# - php-version: "8.1"
# dependencies: lowest-ignore
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have to drop this because it leads to installing dependencies broken on PHP 8.1.

# experimental: true
# - php-version: "8.1"
# dependencies: highest-ignore
# experimental: true
- php-version: "8.0"
dependencies: highest
experimental: false
- php-version: "8.1"
dependencies: lowest-ignore
experimental: true
- php-version: "8.1"
dependencies: highest-ignore
experimental: true

steps:
- name: "Checkout"
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"require-dev": {
"friendsofphp/php-cs-fixer": "~2.2.20 || ~2.19.0",
"json-schema/json-schema-test-suite": "1.2.0",
"phpunit/phpunit": "^4.8.35"
"sanmai/phpunit-legacy-adapter": "^6.4 || ^8.2.1"
},
"extra": {
"branch-alias": {
Expand Down
2 changes: 1 addition & 1 deletion tests/ConstraintErrorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
namespace JsonSchema\Tests;

use JsonSchema\ConstraintError;
use PHPUnit\Framework\TestCase;
use LegacyPHPUnit\TestCase;

class ConstraintErrorTest extends TestCase
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Constraints/FactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
use JsonSchema\Constraints\Constraint;
use JsonSchema\Constraints\Factory;
use JsonSchema\Entity\JsonPointer;
use PHPUnit\Framework\TestCase;
use LegacyPHPUnit\TestCase;

/**
* Class MyBadConstraint
Expand Down
2 changes: 1 addition & 1 deletion tests/Constraints/PointerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
namespace JsonSchema\Tests\Constraints;

use JsonSchema\Validator;
use PHPUnit\Framework\TestCase;
use LegacyPHPUnit\TestCase;

class PointerTest extends TestCase
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Constraints/SchemaValidationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

use JsonSchema\Constraints\Constraint;
use JsonSchema\Validator;
use PHPUnit\Framework\TestCase;
use LegacyPHPUnit\TestCase;

class SchemaValidationTest extends TestCase
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Constraints/TypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

use JsonSchema\Constraints\TypeCheck\LooseTypeCheck;
use JsonSchema\Constraints\TypeConstraint;
use PHPUnit\Framework\TestCase;
use LegacyPHPUnit\TestCase;

/**
* Class TypeTest
Expand Down
2 changes: 1 addition & 1 deletion tests/Constraints/ValidationExceptionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
use JsonSchema\Constraints\Constraint;
use JsonSchema\Exception\ValidationException;
use JsonSchema\Validator;
use PHPUnit\Framework\TestCase;
use LegacyPHPUnit\TestCase;

class ValidationExceptionTest extends TestCase
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Constraints/VeryBaseTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

namespace JsonSchema\Tests\Constraints;

use PHPUnit\Framework\TestCase;
use LegacyPHPUnit\TestCase;
use Prophecy\Argument;

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/Entity/JsonPointerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
namespace JsonSchema\Tests\Entity;

use JsonSchema\Entity\JsonPointer;
use PHPUnit\Framework\TestCase;
use LegacyPHPUnit\TestCase;

/**
* @package JsonSchema\Tests\Entity
Expand Down
2 changes: 1 addition & 1 deletion tests/Exception/InvalidArgumentExceptionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace JsonSchema\Tests\Exception;

use JsonSchema\Exception\InvalidArgumentException;
use PHPUnit\Framework\TestCase;
use LegacyPHPUnit\TestCase;

class InvalidArgumentExceptionTest extends TestCase
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Exception/InvalidSchemaMediaTypeExceptionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace JsonSchema\Tests\Exception;

use JsonSchema\Exception\InvalidSchemaMediaTypeException;
use PHPUnit\Framework\TestCase;
use LegacyPHPUnit\TestCase;

class InvalidSchemaMediaTypeExceptionTest extends TestCase
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Exception/InvalidSourceUriExceptionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace JsonSchema\Tests\Exception;

use JsonSchema\Exception\InvalidSourceUriException;
use PHPUnit\Framework\TestCase;
use LegacyPHPUnit\TestCase;

class InvalidSourceUriExceptionTest extends TestCase
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Exception/JsonDecodingExceptionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace JsonSchema\Tests\Exception;

use JsonSchema\Exception\JsonDecodingException;
use PHPUnit\Framework\TestCase;
use LegacyPHPUnit\TestCase;

class JsonDecodingExceptionTest extends TestCase
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Exception/ResourceNotFoundExceptionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace JsonSchema\Tests\Exception;

use JsonSchema\Exception\ResourceNotFoundException;
use PHPUnit\Framework\TestCase;
use LegacyPHPUnit\TestCase;

class ResourceNotFoundExceptionTest extends TestCase
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Exception/RuntimeExceptionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace JsonSchema\Tests\Exception;

use JsonSchema\Exception\RuntimeException;
use PHPUnit\Framework\TestCase;
use LegacyPHPUnit\TestCase;

class RuntimeExceptionTest extends TestCase
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Exception/UnresolvableJsonPointerExceptionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace JsonSchema\Tests\Exception;

use JsonSchema\Exception\UnresolvableJsonPointerException;
use PHPUnit\Framework\TestCase;
use LegacyPHPUnit\TestCase;

class UnresolvableJsonPointerExceptionTest extends TestCase
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Exception/UriResolverExceptionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace JsonSchema\Tests\Exception;

use JsonSchema\Exception\UriResolverException;
use PHPUnit\Framework\TestCase;
use LegacyPHPUnit\TestCase;

class UriResolverExceptionTest extends TestCase
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Iterators/ObjectIteratorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
namespace JsonSchema\Tests\Iterators;

use JsonSchema\Iterator\ObjectIterator;
use PHPUnit\Framework\TestCase;
use LegacyPHPUnit\TestCase;

class ObjectIteratorTest extends TestCase
{
Expand Down
2 changes: 1 addition & 1 deletion tests/RefTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
namespace JsonSchema\Tests;

use JsonSchema\Validator;
use PHPUnit\Framework\TestCase;
use LegacyPHPUnit\TestCase;

class RefTest extends TestCase
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Rfc3339Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace JsonSchema\Tests;

use JsonSchema\Rfc3339;
use PHPUnit\Framework\TestCase;
use LegacyPHPUnit\TestCase;

class Rfc3339Test extends TestCase
{
Expand Down
2 changes: 1 addition & 1 deletion tests/SchemaStorageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
use JsonSchema\SchemaStorage;
use JsonSchema\Uri\UriRetriever;
use JsonSchema\Validator;
use PHPUnit\Framework\TestCase;
use LegacyPHPUnit\TestCase;

class SchemaStorageTest extends TestCase
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Uri/Retrievers/CurlTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace JsonSchema\Tests\Uri\Retrievers
{
use JsonSchema\Uri\Retrievers\Curl;
use PHPUnit\Framework\TestCase;
use LegacyPHPUnit\TestCase;

class CurlTest extends TestCase
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Uri/Retrievers/FileGetContentsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace JsonSchema\Tests\Uri\Retrievers
{
use JsonSchema\Uri\Retrievers\FileGetContents;
use PHPUnit\Framework\TestCase;
use LegacyPHPUnit\TestCase;

/**
* @group FileGetContents
Expand Down
2 changes: 1 addition & 1 deletion tests/Uri/Retrievers/PredefinedArrayTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace JsonSchema\Tests\Uri\Retrievers;

use JsonSchema\Uri\Retrievers\PredefinedArray;
use PHPUnit\Framework\TestCase;
use LegacyPHPUnit\TestCase;

/**
* @group PredefinedArray
Expand Down
2 changes: 1 addition & 1 deletion tests/Uri/UriResolverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace JsonSchema\Tests\Uri;

use JsonSchema\Uri\UriResolver;
use PHPUnit\Framework\TestCase;
use LegacyPHPUnit\TestCase;

class UriResolverTest extends TestCase
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Uri/UriRetrieverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
use JsonSchema\Exception\JsonDecodingException;
use JsonSchema\Uri\UriRetriever;
use JsonSchema\Validator;
use PHPUnit\Framework\TestCase;
use LegacyPHPUnit\TestCase;

/**
* @group UriRetriever
Expand Down
2 changes: 1 addition & 1 deletion tests/ValidatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace JsonSchema\Tests;

use JsonSchema\Validator;
use PHPUnit\Framework\TestCase;
use LegacyPHPUnit\TestCase;

class ValidatorTest extends TestCase
{
Expand Down