Skip to content

Add tests for v6 - #35

Merged
d-g-codappix merged 12 commits into
6.xfrom
add-tests-for-v6
Nov 14, 2026
Merged

d-g-codappix merged 12 commits into
6.xfrom
add-tests-for-v6

Conversation

@d-g-codappix

Copy link
Copy Markdown
Collaborator

No description provided.

d-g-codappix and others added 10 commits November 14, 2026 12:01
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 and others added 2 commits November 14, 2026 16:43
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>
@d-g-codappix
d-g-codappix merged commit 978ba6d into 6.x Nov 14, 2026
18 checks passed
@d-g-codappix
d-g-codappix deleted the add-tests-for-v6 branch November 14, 2026 16:13
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