Published on June 23, 2013
** Update: Yii2 module was included in release. See details below.**
It was a one-month release sprint and probably this release took much longer then we expected. 1.6.3 release introduces lots of features, internal unit tests, and internal refactorings. Please take a cup of coffee because we prepared a long story of features you can try in 1.6.3.
The major internal change you should be aware of is upgrade to Symfony Components 2.3. This may introduce some instability, or conflicts (if you use previous Symfony version), but the good news are that: Symfony 2.3 is LTS, so we are going to stay on this version for a long time.
This feature was expected by Symfony2 users, as well as other developers who uses several independent applications in a project (as Symfony bundles are). From now on you are not limited to execute tests from only one directory. In Codeception 1.6.3 you can create a meta-config and make it to point to other codeception test configs:
codeception.yml we include tests configs from
app/rest directories. By executing tests from it, we will launch all test suites from this applications.
Symfony2 users now can create a test suite for each bundle they have and then execute all tests in meta config.
If you decided to use a multiple-config option, the first issue you get is conflict of Helper classes and Guy classes. It’s natural to use namespaces to separate those classes of multiple applications. From now on, you can assign a namespace for your test classes.
Thanks to Tiger-seo we got a module that might be very handy for all developers that work with Facebook API.
Don’t leave your Facebook applications untested! With this module you can log in as test user and perform interactions using REST API or HTTP calls.
Before 1.6.3 Helpers was loaded with simple
include_once call. I.e., there was no other option then to load them from
tests/_helpers directory. In 1.6.3 we replaced this call with autoloader, and also we added a global
_bootstrap.php file in which you can prepend any code before helpers are loaded.
Also in 1.6.3 you can customiza which methods of module or helper should be imported into Guy class. In other words, you can enable or disable module methods. If your helper is extended from one of standard modules, you can disable usage of inherited methods and implement them on your own. It is especially useful if you want to rename parent class methods:
More on helper customization.
Codeception’s utility Stub class got lots of improvements by svsool. Mock matching was also added into it, thus you may use shorter mock syntax in your unit tests:
Complete reference is coming soon.
In case you need to execute custom code in a test, you can now use the
execute method for that:
execute method is declared in Guy class itself, thus it can be used anywhere without attaching a module.
As you know, Codeception tests files are included 2 times: one for parsing and for execution. Calls inside
execute method will be triggered only on test execution.
Thanks korotovsky for implementation.
Yii framework hits its second major version. Yii 2.0 was developed with testing in mind. Despite the fact that Yii 2.0 is still in its early days, we got a working Yii2 module for it. Unlike most of framework modules of Codepception, this one was created by Yii core developer qiangxue.
We are excited of collaboration with Yii Framework core team. And we wish them Yii 2.0 project to hit stable release soon.
--no-colorsrunner option by igorsantos07.
seeInDatabasecan check that table is empty with:
ZombieJSupdates by synchrone.
additionally we had lots of fixes to Db module and its drivers. Sorry, we can’t list all of them here.
As it was said we had internal refactorings, to make code stable and clearer. Soon we plan to publish a complete blog on Codeception internals.
codeception.phar for update:
for composer version
Release sponsored by 2AmigOS
Write and execute a test for an existing app
in less then 5 minutes!