Skip to content

Commit 15639f5

Browse files
committed
Add docs
1 parent d027f19 commit 15639f5

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,23 @@ Or generate unit tests:
2323
```bash
2424
bin/magento yireo:test:generate Yireo_Example --type=unit
2525
```
26+
27+
### Extending test types
28+
The Integration Tests can be created by using a custom generator. For instance, there is a `ConfigTestGenerator` which allows for a
29+
specific config test case to be created, as long as the PHP class name matches with `*\Config\Config`.
30+
31+
```xml
32+
<?xml version="1.0"?>
33+
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
34+
<type name="Yireo\TestGenerator\Generator\IntegrationTestGenerator">
35+
<arguments>
36+
<argument name="testGenerators" xsi:type="array">
37+
<item name="custom" xsi:type="object">YireoTraining\ExampleTestGenerator\Generator\IntegrationTest\CustomTestGenerator</item>
38+
</argument>
39+
</arguments>
40+
</type>
41+
</config>
42+
```
43+
44+
This generator class needs to implement `\Yireo\TestGenerator\Generator\IntegrationTest\TestGeneratorInterface`. See the
45+
`\Yireo\TestGenerator\Generator\IntegrationTest\ConfigTestGenerator` for a full example.

0 commit comments

Comments
 (0)