Skip to content

Update 04-FunctionalTests.md #334

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 11, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions docs/04-FunctionalTests.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@ title: 04-FunctionalTests - Codeception - Documentation
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.

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.
Under the hood, Codeception uses Symfony's [BrowserKit](https://symfony.com/doc/current/components/browser_kit.html)
to "send" requests to your app. So there's no real HTTP request made, but rather a BrowserKit
[Request object](https://github.com/symfony/browser-kit/blob/master/Request.php) with the required properties is
passed to your framework's (font-)controller.

Codeception can connect to different PHP 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.
As a first step, you need to enable Codeception's module for your framework in `functional.suite.yml` (see below).

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

{% highlight php %}
Expand Down