Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
7 changes: 3 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
}
],
"require": {
"php": "^7.2",
"php": "^7.2 || ^7.3",
Copy link
Owner

Choose a reason for hiding this comment

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

This is not necessary; ^7.2 already translates to >= 7.2 && < 8.0

Copy link
Author

Choose a reason for hiding this comment

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

You are right. I am used to gracefully update dependencies in libraries due to backwards compatibility, but this is not necessary here.

Copy link
Author

Choose a reason for hiding this comment

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

You are right. I am used to gracefully update dependencies in libraries due to backwards compatibility, but this is not necessary here.

Upon further inspection, I do think it is necessary as with this notation we still allow users with PHP 7.2 to make use of this package with PHPUnit 8, from 7.3 PHPUnit 9 is needed (as it is the minimum requirement).

"flow/jsonpath": "^0.5.0",
"justinrainbow/json-schema": "^5.0"
},
"conflict": {
"phpunit/phpunit": "<8.0 || >= 9.0"
"phpunit/phpunit": "<8.0 || >= 10.0"
},
"require-dev": {
"phpunit/phpunit": "^8.0"
"phpunit/phpunit": "^8.0 || ^9.0"
},
"autoload": {
"psr-4": {
Expand All @@ -26,7 +26,6 @@
},
"autoload-dev": {
"files": [
"vendor/phpunit/phpunit/src/Framework/Assert/Functions.php",
Copy link
Owner

Choose a reason for hiding this comment

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

The functional interface is still alive and well in PHPUnit 9. I don't see the need for removing this include and rewriting the tests in the later files. Can you share your thoughts on why this change was necessary?

Copy link
Author

Choose a reason for hiding this comment

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

The functional interface is still alive and well in PHPUnit 9. I don't see the need for removing this include and rewriting the tests in the later files. Can you share your thoughts on why this change was necessary?

I removed the autoloading as the file was autoloaded twice and so it threw a redeclaration exception. I now imported the functions in the unit test suites to make use of the functional interface. I hope this is fine for you.

"src/Functions.php"
]
},
Expand Down
6 changes: 5 additions & 1 deletion tests/Functional/JsonValueMatchesFluentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
namespace Helmich\JsonAssert\Tests\Functional;

use PHPUnit\Framework\TestCase;
use function PHPUnit\Framework\assertThat;
use function PHPUnit\Framework\equalTo;
use function PHPUnit\Framework\greaterThanOrEqual;
use function PHPUnit\Framework\logicalNot;

class JsonValueMatchesFluentTest extends TestCase
{
Expand Down Expand Up @@ -44,4 +48,4 @@ public function testAssertThatJsonDocumentMatchesJsonConstraints()
)
);
}
}
}
1 change: 1 addition & 0 deletions tests/Functional/JsonValueMatchesSchemaFluentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
use Helmich\JsonAssert\JsonAssertions;
use PHPUnit\Framework\AssertionFailedError;
use PHPUnit\Framework\TestCase;
use function PHPUnit\Framework\assertThat;

class JsonValueMatchesSchemaFluentTest extends TestCase
{
Expand Down