This Codeception release is all about minor but useful features. Starting from 1.0.3 you will be notified on every new Codeception release from console.
If you are not running tests, Codeception Cli application will check for new version and notify you if it is available.
There are new generators for empty tests: Cest and Cept files. Empty test suite can be generated too. Just check new ‘generate:’ commands.
But the most interesting generation feature is Agile Documentation. From now you can improve your documentation generated by DocBlox by appending test scenarios into text. With Codeception BDD approach to Unit Tests it’s easy to imagine every test as usage documentation.
The concept of Agile Documentation will be demonstrated in following example:
We have a sample static method for creating an entity Group. Which can be group of people in social network, for example.
This method uses Doctrine 2 as ORM.
This method requires Id of user who creates group and group name. Here is test for this function:
This test is translated into documentation for Group::create method.
Codeception scans for all Cest files and for all classes passed to DocBlox. When tests match the function in documentation the test is processed and appended into function description.
To start using Codeception with DocBlox you should use the same project root for both projects, i.e. codeception.yml and docblox.xml should be in one directory.
Include plugin into docblox.xml:
As you see, you should specify path to PEAR explicitly. This is DocBlox limitation. Plugins can be either local or provided with DocBlox distribution. I’m not sure how to deal with current Codeception plugin for DocBlox, so I asked this question on GitHub. I hope in near future a better solution will be proposed.
- replaced suppressed errors with error elimination (thanks to jonphipps)
- fixed scenario generations
- fixed generation of html reports
Please update your version via PEAR:
or download updated Phar package.