This week, the n98-magerun2 test framework for modules received an update.
The test framework is intended for third-party modules that provide Magerun commands.
The abstract test classes have been adjusted to be compatible with PHPUnit 9.
The examples in the README and
the example phpunit.xml have also been updated.
At netz98, we have several Magerun modules. Among other things, the Migron tool was implemented as an n98-magerun2 module. In my view, it is important that important Magerun commands are tested too. The framework can easily be installed in your own module via Composer as a Dev-Dependency*.
The composer.json could then look like this, for example:
{ "name": "acme/example", "description": "Some commands", "require-dev": { "n98/magerun2": "^4", "n98/magerun2-test-framework": "^2", "phpunit/phpunit": "^9" }, "autoload-dev": { "psr-4": { "Acme\\Example\\": "tests" } }, "autoload": { "psr-4": { "Acme\\Example\\": "src" } } }