Skip to content
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

PHPUnit Compatibility Layer #11

Merged
merged 18 commits into from
Dec 18, 2021
Merged

PHPUnit Compatibility Layer #11

merged 18 commits into from
Dec 18, 2021

Conversation

nibra
Copy link
Contributor

@nibra nibra commented Dec 18, 2021

Summary of Changes

Add an alternative TestCase class that hides the issues with incompatible signatures for PHPUnit < 7.0 and PHPUnit >= 7.0.

Testing Instructions

Take an existing test class working with PHPUnit < 7.0, extend it from Joomla\Test\TestCase instead of PHPUnit\Framework\TestCase.
Run the test with PHPUnit >= 7.0.
PHP should not complain about incompatible signatures.

Documentation Changes Required

README was updated accordingly.

nibra added 18 commits December 16, 2021 13:53
A lot of files are identical throughout the different packages.
This is the base for unifying them for easier handling.
The images used for tests with these versions have problems with using composer (giving curl error 60), so they are removed for now, until a solution is found.
Used for signing the generated .drone.yml file
Generate .drone.yml
There's a bug in the lowest possible version of phpunit/phpunit-mock-objects. Therefore, that dependency gets updated separately.
The public API contains methods being named _ (e.g., joomla/language)
Some libraries and APIs use snake case names, causing code style checker to complain.
As some packages irreversibly violate our code style by using underscores in variable and method names, the loose check will let names with underscore pass. This check must pass. The strict check is applied without any exceptions, but allowed to fail, so we still get informed about these violations.
Joomla.NamingConventions.ValidVariableName.NotCamelCaps was still checked.
Since the CMS has expressed a need for PHP 8.1 compatible versions of the packages from Framework 1, compatibility should also be tested.
PHPUnit 6.5 fails on PHP 8.1
This reverts commit 27ee84f71de1431043e7248a388c0989042b8b29.
Remove 'ignore-deps' directive from PHP 8 pipelines
This is an attempt to find the cause for tests not even being executed under certain, yet unknown, circumstances.
The phpunit.xml should only specify values that are required by the test environment. Everything that the tests themselves require should be made available via bootstrap.php.
Derive your tests from \Joomla\Test\TestCase instead of \PHPUnit\Framework\TestCase to avoid problems with the signature change in PHPUnit 7.0.
Composer will use PHPUnit 4.8.36 otherwise.
It is suggested, no (test) code is relying on it being present.
Add a paragraph about the purpose and usage of Joomla\Test\TestCase.
@nibra nibra merged commit 55adad5 into 1.x-dev Dec 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant