[TASK] Add basic unit and functional tests#2107
Open
sbuerk wants to merge 1 commit into
Open
Conversation
470c226 to
1717380
Compare
This change adds following tests: * `Tests/Functional/ExtensionLoadedTest.php` to verify that extension is detected as loaded with expected extension key and composer package name. On top it tests against expected TYPO3 core versions using group excludes, which helps to simpler detect if tests for one core version are executed with the other version installed. * `Tests/Unit/VersionCompatTest.php` tests against expected TYPO3 core versions using group excludes, which helps to simpler detect if tests for one core version are executed with the other version installed. In general these two tests can act as first tests for any extension to have unit and functional test infrastructure added. Having at least the functional tests helps detecting DI container compile issues or automatic TCA migrations and related deprecations early - even if no other thats are added. For example, if `12.4` has been used to install the dependencies and the unit/functional tests are executed giving the `-t 13.4` option these tests will fail and indicates this - other failures can than be early ruled out and avoids wasting debug time `ci.yaml` is modified to call unit and functional test with the same TYPO3 version used to setup the system. > [!NOTE] > Existing similar tests are removed in favour of the new ones, > and having them on the lowest level makes them easy findable.
Contributor
|
I've created a pre-PR for moving and renaming the testcases: #2108 |
oliverklee
requested changes
May 1, 2026
Contributor
oliverklee
left a comment
There was a problem hiding this comment.
(not a full review yet, and would like the pre-PR to get merged first)
| * This can and should be used in every extension instead of dummy assertTrue(true) filler. | ||
| */ | ||
| #[CoversNothing] | ||
| final class VersionCompatTest extends UnitTestCase |
Contributor
There was a problem hiding this comment.
Let's avoid the abbreviation:
Suggested change
| final class VersionCompatTest extends UnitTestCase | |
| final class VersionCompatibiltyTest extends UnitTestCase |
This file contains hidden or 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
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.
This change adds following tests:
Tests/Functional/ExtensionLoadedTest.phpto verify thatextension is detected as loaded with expected extension
key and composer package name. On top it tests against
expected TYPO3 core versions using group excludes, which
helps to simpler detect if tests for one core version
are executed with the other version installed.
Tests/Unit/VersionCompatTest.phptests against expectedTYPO3 core versions using group excludes, which helps to
simpler detect if tests for one core version are executed
with the other version installed.
In general these two tests can act as first tests for any
extension to have unit and functional test infrastructure
added. Having at least the functional tests helps detecting
DI container compile issues or automatic TCA migrations and
related deprecations early - even if no other thats are added.
For example, if
12.4has been used to install the dependenciesand the unit/functional tests are executed giving the
-t 13.4option these tests will fail and indicates this - other failures
can than be early ruled out and avoids wasting debug time
ci.yamlis modified to call unit and functional test with thesame TYPO3 version used to setup the system.
Note
Existing similar tests are removed in favour of the new ones,
and having them on the lowest level makes them easy findable.