4. Functional Tests

Functional Tests

Now that we’ve written some acceptance tests, functional tests are almost the same, with one major difference: functional tests don’t require a web server to run tests.

In simple terms we set the $_REQUEST, $_GET and $_POST variables and then we execute the application from a test. This may be valuable as functional tests are faster and provide detailed stack traces on failures.

Codeception can connect to different web frameworks that support functional testing: Symfony2, Laravel5, Yii2, Zend Framework and others. You just need to enable the desired module in your functional suite configuration to start.

Modules for all of these frameworks share the same interface, and thus your tests are not bound to any one of them. This is a sample functional test:

<?php
$I = new Fu