Unit tests are pretty common everywhere. And Codeception doesn't reinvent the weel, as it's based on top of PHPUnit.
The major feature of Codeception are functional tests. You are not testing the Controller class, but it's actual behavior, from the user's perspective.
It would be cool if you can test the CRUD functionality by emulating the user, but without connecting to actual web site.
Codeception connects to the application, emulates requests, parses responses, and submits next requests...
And so you can run this scenario without touching a browser or webserver
$I = new WebGuy($scenario);
$I->wantTo('create wiki page');
$I->amOnPage('/');
$I->click('Pages');
The problem here is that our web application stays in memory, instead of dying after each request (as it's used in PHP).
And so we need to perform a complete clean up each time the request is sent.
Basically I need to know: what's with memory management? Will the long-living application work on top of Phalcon? What should be cleaned?
How the headers are sent? Can they be skipped in test environment?
Do you have a test environment?
Does your ORM support nested transactions? This way we can roll back all the changes after the test.
And about unit tests...
They are cool, but they shouldn't be the first to write for a web application. As web developer should see an applications works as a whole, and not just one class.
And that's why I think functional tests are important.
Вівторок, 23 жовтня 2012 р. 21:07:35 UTC+3 користувач Andres-Gutierrez написав: