Repository navigation
Add tests for v6 - #35
Merged
Merged
Conversation
The ProviderRedirect listener splits the provider of every payment into provider and clearing type. Providers of other extensions without an underscore, e.g. PAYPAL of cart_paypal, caused the warning "Undefined array key 1". The missing clearing type defaults to an empty string now, like in the PaymentController. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Girosolution calls the notifyAction after a payment and only expects the HTTP status. The action rendered a template that does not exist, so the request failed after the payment had been updated, and Girosolution retried the notification. The action returns an empty response now. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The extension had no tests so far. The setup follows the other cart extensions: Build/phpunit.xml.dist with the testsuites unit and functional, run via Build/Scripts/phpunit.sh, the composer scripts project:test:unit and project:test:functional, the commands project-test-unit and project-test-functional in shell.nix and a CI job for all supported PHP versions. The tests are linted and analysed by PHPStan as well, Build/phpunit.xml.dist is validated by the xml lint. The unit tests cover the credential loaders, the events and the event listeners as far as they do not need the API of Girosolution. The functional tests send the notification of Girosolution to the frontend and check the stored payment and transaction and the dispatched events for successful and canceled payments, for repeated notifications, for a wrong hash and an unknown cart. They also verify that credentials from TYPO3_CONF_VARS override the ones from TypoScript. The events are recorded by the listener of the test extension girosolution_test, as frontend requests use their own listener provider. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Build/Scripts/coverage.sh runs every testsuite in its own phpunit process like phpunit.sh, merges the coverage with phpcov, prints the summary and writes the html report to .Build/coverage. It is available as composer script project:test:coverage and as project-test-coverage in shell.nix, which provides php with xdebug. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Girosolution redirects the customer to the redirectAction after the payment. The tests check the redirect to the order or back to the cart, the stored payment and transaction, the dispatched events, the cart and flash message restored in the session after a canceled payment and the rejection of requests with a wrong hash or without cart hash. The tests of the notifyAction are moved to their own class and cover PayPal payments, unknown clearing types and payments without transaction as well. TYPO3 v13 sends the redirect of an Extbase plugin via header() instead of the response, so the target of the redirect is not checked on this branch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The test extension girosolution_test registers its listener in Services.php instead of Services.yaml. The classes are referenced by their class constants, so a renamed or moved class is found by the IDE and PHPStan. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The PaymentController, ext_localconf.php and the TCA override were the only PHP files without strict types. The tests cover the controller, so type errors in calls from it are detected now. ext_emconf.php is left untouched, it only returns the configuration for the TYPO3 Extension Repository. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The extension can only be installed with Composer, because the dependency girosolution/girocheckout-sdk cannot be installed by the extension manager. In Composer mode TYPO3 uses composer.json, so ext_emconf.php is not needed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The rule declare_strict_types reports PHP files without strict types, project:cgl:fix adds the declaration. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The services were configured partly in Services.yaml and partly in Services.php. All services are configured in Services.php now, the classes are referenced by their class constants, so a renamed or moved class is found by the IDE and PHPStan. A functional test checks the registered event listeners and that the cart is cleared before the customer is redirected to Girosolution. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
d-g-codappix
force-pushed
the
add-tests-for-v6
branch
from
November 14, 2026 15:36
31dc934 to
7d29513
Compare
The email listener of cart is registered a second time for the FinishEvent of this extension, because the FinishEvent of cart is not dispatched for payments with Girosolution. The service id looked like a class of this extension that does not exist. It is a descriptive id now, the class of the service is the listener of cart. The identifier of the event listener is unchanged. The change is documented as breaking change in the changelog of 6.0, the release which introduces it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The version 6.x requires extcode/cart 11.x, not 10.x. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
No description provided.