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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set PHP 7.2 as minimum version, upgrade to PHPUnit 8.5 and GuzzleHttp 7.7 #1903
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dregad
force-pushed
the
php72
branch
2 times, most recently
from
August 14, 2023 15:00
34207fa
to
1347713
Compare
Fixes #27840
Issue #27840
Issue #27840
With PHPUnit 8.5, which supports PHP >= 7.2, we no longer need the temporary changes from issue #29882 to provide PHP 8.1 compatibility. This reverts commit f82c03b by removing the dependencies on custom forks of PHPUnit and required libraries. Fixes #32810
- Removing phpdocumentor/reflection-common (1.0.1) - Removing phpdocumentor/reflection-docblock (4.3.4) - Removing phpdocumentor/type-resolver (0.5.1) - Removing phpspec/prophecy (v1.10.3) - Removing phpunit/phpunit-mock-objects (5.0.10) - Removing symfony/polyfill-ctype (v1.19.0) - Removing webmozart/assert (1.9.1) - Upgrading doctrine/instantiator (1.0.5 => 1.5.0) - Upgrading myclabs/deep-copy (1.7.0 => 1.11.1) - Upgrading phar-io/manifest (1.0.1 => 2.0.3) - Upgrading phar-io/version (1.0.1 => 3.2.1) - Upgrading phpunit/php-code-coverage (dev-mantis-5.3 7642884 => 7.0.15) - Upgrading phpunit/php-file-iterator (dev-mantis-1.4 89be108 => 2.0.5) - Upgrading phpunit/php-timer (1.0.9 => 2.1.3) - Upgrading phpunit/php-token-stream (2.0.2 => 3.1.3) - Upgrading phpunit/phpunit (dev-mantis-6.5 215feef => 8.5.33) - Upgrading sebastian/comparator (2.1.3 => 3.0.5) - Upgrading sebastian/diff (2.0.1 => 3.0.4) - Upgrading sebastian/environment (3.1.0 => 4.2.4) - Upgrading sebastian/exporter (3.1.4 => 3.1.5) - Upgrading sebastian/global-state (2.0.0 => 3.0.3) - Upgrading sebastian/resource-operations (1.0.0 => 2.0.2) - Locking sebastian/type (1.1.4) - Upgrading theseer/tokenizer (1.1.3 => 1.2.1)
Replace with assertThat() and isType() constraint.
Replace with $this->expectException()
Replace with assertStringContainsString()
Replace with expectExceptionMessageMatches()
Prevents PHPUnit from throwing a warning: No tests found in class "RestBase".
Fixes #32807
- Removing symfony/polyfill-php72 (v1.19.0) - Removing symfony/polyfill-php70 (v1.19.0) - Removing symfony/polyfill-intl-normalizer (v1.19.0) - Removing symfony/polyfill-intl-idn (v1.19.0) - Removing paragonie/random_compat (v9.99.100) - Installing symfony/deprecation-contracts (v2.5.2) - Installing psr/http-client (1.0.2) - Upgrading guzzlehttp/guzzle (6.5.8 => 7.6.1) Fixes #32807
Initialize defaultSoapClientOptions property in setUp(), to avoid a syntax error due to undefined constant WSDL_CACHE_NONE. Remove useless SoapAllTests::setUp() method. TestSuite class does not have this method so it is never actually called. Extension availability check is performed by `@requires extension` hints in the test cases' PHPDoc blocks. Fixes #32814
Argument #1 of PHPUnit\Framework\TestSuite::addTestSuite() must be a class name or object AllTests::suite() method called addTest() instead of addTestSuite() to include the 3 tests suites. Fixes #32815
Until today, the test suites were defined in "AllTests.php" files using the PHPUnit\Framework\TestSuite class, which is meant for internal use. The official, documented method to compose a test suite is to use XML configuration. This commit introduces the phpunit.xml, which replaces the AllTests.php scripts, and updates documentation and TravisCI script. Fixes #32816
When building test email addresses, use the user and domain from the TEST_EMAIL constant, to ensure the test cases in providerEmailUnique remain relevant in case the reference email is modified.
This avoids 'sh: 1: /usr/sbin/sendmail: not found' error message displayed after PHPUnit suite execution, as sendmail is not installed on Travis. Note: This is not a "real" error and does not actually cause the build to fail, but it could lead someone reviewing the build's log to think that something went wrong, so it should be fixed to avoid confusion. The fakesendmail.sh script was copied from PHPMailer's test suite [1]. It will generate a .eml file in /tmp/fakemail directory, each time the test suite sends an email. Fixes #32828 [1]: https://github.com/PHPMailer/PHPMailer/blob/v6.8.0/test/fakesendmail.sh
I believe I've now identified and fixed all issues related to upgrading the test suite to PHPUnit 8.5. So this PR is now ready for review. I'm planning to merge it by the end of the week, please test provide your feedback by then. |
dregad
added a commit
that referenced
this pull request
Aug 18, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The PR is created in draft mode, because at this stage it is still a work-in-progress. There are remaining issues when running PHPUnit tests locally with PHP 8.1 and above that need to be resolved, but 7.4 and 8.0 seem to be fine.The early submission allows the code changes to go through our standard TravisCI build process, and gives everyone an opportunity to preview and test. Feedback would be appreciated 馃檹
This fixes: