Download the PHP package yireo/magento2-test-generator without Composer
On this page you can find all versions of the php package yireo/magento2-test-generator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package magento2-test-generator
Yireo TestGenerator for Magento 2
Use this module to kickstart unit tests or integration tests for your existing module.
Installation
Usage
Generate integration tests for the module Yireo_Example
if they don't exist yet:
Or generate integration tests, overriding existing tests as well (DANGEROUS) unless there is a token @test-generator-skip-override
found in the test file contents:
Or generate unit tests:
Generate unit tests, overriding the original test, for a specific class only: `
AI generated tests
This module also offers to generate unit tests or integration tests by using AI. The tests generated might not always be perfect and might not even work. To the least, they offer you a kickstart instead of needing to code things yourself.
The following coding AIs are currently supported:
- OpenAI (ChatGPT)
- Anthropic (Claude AI)
Both require an API key to be used. Note that these AI platforms will bill you according to your usage.
In the Store Configuration under Yireo > Test Generator you can enable each AI and configure an API key.
Extending test types
The Integration Tests can be created by using a custom generator. For instance, there is a ConfigTestGenerator
which allows for a
specific config test case to be created, as long as the PHP class name matches with *\Config\Config
.
This generator class needs to implement \Yireo\TestGenerator\Generator\IntegrationTest\SourceTestGeneratorInterface
. See the
\Yireo\TestGenerator\Generator\IntegrationTest\ConfigTestGenerator
for a full example.
Todo
- Move the AI mechanisms in separate modules
- Allow to configure the AI prompt yourself
- Add a dry-run flag
All versions of magento2-test-generator with dependencies
nette/php-generator Version ^4.1
nette/utils Version ^4.0