Skip to content

Commit 416b7e9

Browse files
committed
auto updated documentation
1 parent deae39d commit 416b7e9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+2725
-2308
lines changed

_includes/guides.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<li><a href="/docs/01-Introduction">Introduction</a></li><li><a href="/docs/02-GettingStarted">Getting Started</a></li><li><a href="/docs/03-AcceptanceTests">Acceptance Tests</a></li><li><a href="/docs/04-FunctionalTests">Functional Tests</a></li><li><a href="/docs/05-UnitTests">Unit Tests</a></li><li><a href="/docs/06-ReusingTestCode">Reusing Test Code</a></li><li><a href="/docs/07-AdvancedUsage">Advanced Usage</a></li><li><a href="/docs/08-Customization">Customization</a></li><li><a href="/docs/09-Data">Data</a></li><li><a href="/docs/10-WebServices">Web Services</a></li><li><a href="/docs/11-Codecoverage">Codecoverage</a></li><li><a href="/docs/12-ParallelExecution">Parallel Execution</a></li>
1+
<li><a href="/docs/01-Introduction">Introduction</a></li><li><a href="/docs/02-GettingStarted">Getting Started</a></li><li><a href="/docs/03-ModulesAndHelpers">Modules And Helpers</a></li><li><a href="/docs/04-AcceptanceTests">Acceptance Tests</a></li><li><a href="/docs/05-FunctionalTests">Functional Tests</a></li><li><a href="/docs/06-UnitTests">Unit Tests</a></li><li><a href="/docs/07-AdvancedUsage">Advanced Usage</a></li><li><a href="/docs/08-Customization">Customization</a></li><li><a href="/docs/09-Data">Data</a></li><li><a href="/docs/10-WebServices">Web Services</a></li><li><a href="/docs/11-Codecoverage">Codecoverage</a></li><li><a href="/docs/12-ParallelExecution">Parallel Execution</a></li>

_includes/modules.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<li><a href="/docs/modules/AMQP">AMQP</a></li><li><a href="/docs/modules/PhpBrowser">PhpBrowser</a></li><li><a href="/docs/modules/Asserts">Asserts</a></li><li><a href="/docs/modules/Queue">Queue</a></li><li><a href="/docs/modules/Cli">Cli</a></li><li><a href="/docs/modules/REST">REST</a></li><li><a href="/docs/modules/Db">Db</a></li><li><a href="/docs/modules/Redis">Redis</a></li><li><a href="/docs/modules/Dbh">Dbh</a></li><li><a href="/docs/modules/SOAP">SOAP</a></li><li><a href="/docs/modules/Doctrine2">Doctrine2</a></li><li><a href="/docs/modules/Sequence">Sequence</a></li><li><a href="/docs/modules/FTP">FTP</a></li><li><a href="/docs/modules/Silex">Silex</a></li><li><a href="/docs/modules/Facebook">Facebook</a></li><li><a href="/docs/modules/Symfony2">Symfony2</a></li><li><a href="/docs/modules/Filesystem">Filesystem</a></li><li><a href="/docs/modules/WebDriver">WebDriver</a></li><li><a href="/docs/modules/Laravel4">Laravel4</a></li><li><a href="/docs/modules/XMLRPC">XMLRPC</a></li><li><a href="/docs/modules/Laravel5">Laravel5</a></li><li><a href="/docs/modules/Yii1">Yii1</a></li><li><a href="/docs/modules/Lumen">Lumen</a></li><li><a href="/docs/modules/Yii2">Yii2</a></li><li><a href="/docs/modules/Memcache">Memcache</a></li><li><a href="/docs/modules/ZF1">ZF1</a></li><li><a href="/docs/modules/MongoDb">MongoDb</a></li><li><a href="/docs/modules/ZF2">ZF2</a></li><li><a href="/docs/modules/Phalcon1">Phalcon1</a></li>
1+
<li><a href="/docs/modules/AMQP">AMQP</a></li><li><a href="/docs/modules/Phalcon1">Phalcon1</a></li><li><a href="/docs/modules/Asserts">Asserts</a></li><li><a href="/docs/modules/PhpBrowser">PhpBrowser</a></li><li><a href="/docs/modules/Cli">Cli</a></li><li><a href="/docs/modules/Queue">Queue</a></li><li><a href="/docs/modules/Db">Db</a></li><li><a href="/docs/modules/REST">REST</a></li><li><a href="/docs/modules/Dbh">Dbh</a></li><li><a href="/docs/modules/Redis">Redis</a></li><li><a href="/docs/modules/Doctrine1">Doctrine1</a></li><li><a href="/docs/modules/SOAP">SOAP</a></li><li><a href="/docs/modules/Doctrine2">Doctrine2</a></li><li><a href="/docs/modules/Sequence">Sequence</a></li><li><a href="/docs/modules/FTP">FTP</a></li><li><a href="/docs/modules/Silex">Silex</a></li><li><a href="/docs/modules/Facebook">Facebook</a></li><li><a href="/docs/modules/Symfony1">Symfony1</a></li><li><a href="/docs/modules/Filesystem">Filesystem</a></li><li><a href="/docs/modules/Symfony2">Symfony2</a></li><li><a href="/docs/modules/Kohana">Kohana</a></li><li><a href="/docs/modules/WebDriver">WebDriver</a></li><li><a href="/docs/modules/Laravel4">Laravel4</a></li><li><a href="/docs/modules/XMLRPC">XMLRPC</a></li><li><a href="/docs/modules/Laravel5">Laravel5</a></li><li><a href="/docs/modules/Yii1">Yii1</a></li><li><a href="/docs/modules/Lumen">Lumen</a></li><li><a href="/docs/modules/Yii2">Yii2</a></li><li><a href="/docs/modules/Memcache">Memcache</a></li><li><a href="/docs/modules/ZF1">ZF1</a></li><li><a href="/docs/modules/MongoDb">MongoDb</a></li><li><a href="/docs/modules/ZF2">ZF2</a></li>

changelog.markdown

Lines changed: 5 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -7,41 +7,11 @@ title: Codeception Changelog
77

88
# Changelog
99

10-
#### 2.1.0
11-
12-
* <strong>[Recorder]</strong>(https://github.com/Codeception/Codeception/tree/master/ext#codeceptionextensionrecorder) extension added. Shows acceptance test progress with a recorded slideshow.
13-
* **Updated to Guzzle 6**. Codeception can now work both with Guzzle v5 and Guzzle v6. PhpBrowser chooses right connector depending on Guzzle version installed. By <strong><a href="https://github.com/davertmik">@davertmik</a></strong> and <strong><a href="https://github.com/enumag">@enumag</a></strong>
14-
* Annotations in Cept files.
15-
Instead of calling `$scenario->skip()`, `$scenario->group('firefox')`, etc, it is recommended to set scenario metadata with annotations `// <strong><a href="https://github.com/skip">@skip</a></strong>`, `// <strong><a href="https://github.com/group">@group</a></strong> firefox`.
16-
Annotations can be parsed from line or block comments. `$scenario->skip()` and `$scenario->incomplete()` are still valid and can be executed inside conditional statements:
17-
```
18-
if (!extension_loaded('xdebug')) $scenario->skip('Xdebug required')
19-
```
20-
* **PSR-4**: all support classes moved to `tests/_support` by default. Actors, Helpers, PageObjects, StepObjects, GroupObjects to follow PSR-4 naming style. Autoloader implemented by <strong><a href="https://github.com/splinter89">@splinter89</a></strong>.
21-
* **Dependency Injection**: support classes can be injected into tests. Support classes can be injected into each other too. This happens by implementing method `_inject` and explicitly specifying class names as parameters. Implemented by <strong><a href="https://github.com/splinter89">@splinter89</a></strong>.
22-
* **Actor classes can be extended**, their generated parts were moved to special traits in `_generated` namespace. Each *Tester class can be updated with custom methods.
23-
* **Module config simplified**: Modules can be configured in `enabled` section of suite config.
24-
* **Conflicts**: module can define conflicts with each other by implementing `_conflicts` method
25-
* **Dependencies**: module can explicitly define dependencies and expect their injection by implementing `_inject` and `_depends` methods and relying on dependency injection container.
26-
* **Current** modules, environment, and test name can be received in scenario. Example: `$scenario->current('env')` returns current environment name. Fixes <a href="https://github.com/Codeception/Codeception/issues/1251">#1251</a>
27-
* **Environment Matrix**: environments can be merged. Environment configs can be created in `tests/_envs`, environment generator added. Implemented by By <strong><a href="https://github.com/sjableka">@sjableka</a></strong>. See <a href="https://github.com/Codeception/Codeception/issues/1747">#1747</a>
28-
* **Custom Printers**: XML, JSON, TAP, Report printers can be redefined in configuration. See <a href="https://github.com/Codeception/Codeception/issues/1425">#1425</a>
29-
* <strong>[Db]</strong> Added `reconnect` option for long running tests, which will connect to database before the test and disconnect after. By <strong><a href="https://github.com/Naktibalda">@Naktibalda</a></strong>
30-
* Module parts. Actions of modules can be loaded partially in order to disable actions which are not used in current tests. For instance, disable web actions of framework modules in unit testsing.
31-
* **Kohana**, **Symfony1**, **Doctrine1** modules considered deprecated and moved to standalone packages.
32-
* `shuffle` added to settings. Randomizes order of running tests. See <a href="https://github.com/Codeception/Codeception/issues/1504">#1504</a>
33-
* Console output improved: scenario stack traces contain files and lines of fail.
34-
* <strong>[Doctrine2]</strong><strong>[Symfony2]</strong> `symfony_em_service` config option moved from Doctrine2 to Symfony2 module and renamed to `em_service` *2015-06-03*
35-
* <strong>[PhpBrowser]</strong><strong>[Frameworks]</strong> Fixed cloning form nodes `Codeception\Lib\InnerBrowser::getFormFromCrawler(): ID XXX already defined` *2015-05-13*
36-
* <strong>[WebDriver]</strong> session snapshot implemented, allows to store cookies and load them, i.e., to keep user session between testss.
37-
* <strong>[WebDriver]</strong><strong>[PhpBrowser]</strong><strong>[Frameworks]</strong> Malformed XPath locators wil throw an exception <a href="https://github.com/Codeception/Codeception/issues/1441">#1441</a>
38-
* `MODULE_INIT` event is fired before initializing modules <a href="https://github.com/Codeception/Codeception/issues/1370">#1370</a>
39-
* Graceful tests termination using `pcntl_signal`. See <a href="https://github.com/Codeception/Codeception/issues/1286">#1286</a>
40-
* Group classes renamed to GroupObjects; Base GroupObject class renamed to `Codeception\GroupObject`
41-
* Official extensions moved to `ext` dir; Base Extension class renamed to `Codeception\Extension`
42-
* Duplicate environment options won't cause Codeception to run environment tests twice
43-
* <strong>[Phalcon1]</strong> `haveServiceInDi` method implemented by <strong><a href="https://github.com/sergeyklay">@sergeyklay</a></strong>
44-
* <strong>[Db]</strong> `seeNumRecords` method added by <strong><a href="https://github.com/sergeyklay">@sergeyklay</a></strong>
10+
#### 2.0.16
11+
12+
* <strong>[REST]</strong> Module usage should not depend on order it was declared. Fixes <a href="https://github.com/Codeception/Codeception/issues/2100">#2100</a> by <strong><a href="https://github.com/Naktibalda">@Naktibalda</a></strong>
13+
* <strong>[Db]</strong> When `populate` is enabled cleanup should happen only if enabled too <a href="https://github.com/Codeception/Codeception/issues/2148">#2148</a> by <strong><a href="https://github.com/gammamatrix">@gammamatrix</a></strong>
14+
* <strong>[Laravel5]</strong> Rewrite of module to fix open issues and other problems *2015-07-09*
4515

4616
#### 2.0.15
4717

@@ -152,11 +122,6 @@ Modifications to ensure multiple values get sent correctly.
152122
* <strong>[Yii2]</strong> Fixed usage of PUT method by <strong><a href="https://github.com/miroslav">@miroslav</a></strong>-chandler *2015-02-23*
153123

154124

155-
#### 2.1.0
156-
157-
* <strong>[WebDriver]</strong> Saving and restoring session snapshots implemented *2015-03-16*
158-
159-
160125
#### 2.0.10
161126

162127
* **Console Improvement**: better formatting of test progress. Improved displaying of debug messages and PHP Fatal Errors.

docs/01-Introduction.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Please, note that **any website** can be covered with acceptance tests. Even if
3232
$I = new AcceptanceTester($scenario);
3333
$I->amOnPage('/');
3434
$I->click('Sign Up');
35-
$I->submitForm('#signup', ['username' => 'MilesDavis', 'email' => 'miles@davis.com']);
35+
$I->submitForm('#signup', array('username' => 'MilesDavis', 'email' => 'miles@davis.com'));
3636
$I->see('Thank you for Signing Up!');
3737
?>
3838

@@ -68,10 +68,10 @@ For functional tests your application should be prepared to be run in a test env
6868
$I = new FunctionalTester($scenario);
6969
$I->amOnPage('/');
7070
$I->click('Sign Up');
71-
$I->submitForm('#signup', ['username' => 'MilesDavis', 'email' => 'miles@davis.com']);
71+
$I->submitForm('#signup', array('username' => 'MilesDavis', 'email' => 'miles@davis.com'));
7272
$I->see('Thank you for Signing Up!');
7373
$I->seeEmailSent('miles@davis.com', 'Thank you for registration');
74-
$I->seeInDatabase('users', ['email' => 'miles@davis.com']);
74+
$I->seeInDatabase('users', array('email' => 'miles@davis.com'));
7575
?>
7676

7777
{% endhighlight %}
@@ -109,7 +109,7 @@ function testSavingUser()
109109
$user->setSurname('Davis');
110110
$user->save();
111111
$this->assertEquals('Miles Davis', $user->getFullName());
112-
$this->unitTester->seeInDatabase('users', ['name' => 'Miles', 'surname' => 'Davis']);
112+
$this->unitTester->seeInDatabase('users',array('name' => 'Miles', 'surname' => 'Davis'));
113113
}
114114
?>
115115

@@ -136,4 +136,4 @@ It could be called a BDD framework. All Codeception tests are written in a descr
136136

137137

138138

139-
* **Next Chapter: [GettingStarted >](/docs/02-GettingStarted)**
139+
* **Next Chapter: [GettingStarted >](/docs/02-GettingStarted)**<p>&nbsp;</p><div class="alert alert-warning">Docs are incomplete? Outdated? Or you just found a typo? <a href="https://github.com/Codeception/Codeception/tree/2.0/docs">Help us to improve documentation. Edit it on GitHub</a></div>

docs/02-GettingStarted.md

Lines changed: 17 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,11 @@ Let's take a look at Codeception's architecture. We assume that you already [ins
1111

1212
One of the main concepts of Codeception is representation of tests as actions of a person. We have a UnitTester, who executes functions and tests the code. We also have a FunctionalTester, a qualified tester, who tests the application as a whole, with knowledge of its internals. And an AcceptanceTester, a user that works with our application through an interface that we provide.
1313

14-
Actor classes are not written but generated from suite configuration. **Methods of actor classes are generally taken from Codeception Modules**. Each module provides predefined actions for different testing purposes, and they can be combined to fit the testng environment. Codeception tries to solve 90% of possible testing issues in its modules, so you don't have reinvent the wheel. We think that you can spend more time on writing tests and less on writing support code to make those tests run. By default AcceptanceTester relies on PhpBrowser module, which is set in `tests/acceptance.suite.yml` configuration file:
14+
Each of these Actors are PHP classes along with the actions that they are allowed to do. As you can see, each of these Actors have different abilities. They are not constant, you can extend them. One Actor belongs to one testing suite.
1515

16-
{% highlight yaml %}
17-
18-
class_name: AcceptanceTester
19-
modules:
20-
enabled:
21-
- PhpBrowser:
22-
url: http://localhost/myapp/
23-
- \Helper\Acceptance
24-
25-
{% endhighlight %}
16+
Actor classes are not written but generated from suite configuration. When you change configuration, actor classes are **rebuilt automatically**.
2617

27-
In this configuration file you can enable/disable and reconfigure modules for your needs.
28-
When you change configuration, actor classes are rebuilt automatically. If Actor classes are not created or updated as you expect, try to generate them manually with `build` command:
18+
If Actor classes are not created or updated as you expect, try to generate them manually with `build` command:
2919

3020
{% highlight bash %}
3121

@@ -78,12 +68,9 @@ Before we execute this test, we should make sure that the website is running on
7868

7969
{% highlight yaml %}
8070

81-
class_name: AcceptanceTester
82-
modules:
83-
enabled:
84-
- PhpBrowser:
85-
url: 'http://myappurl.local'
86-
- \Helper\Acceptance
71+
config:
72+
PhpBrowser:
73+
url: 'http://myappurl.local'
8774

8875
{% endhighlight %}
8976

@@ -144,70 +131,28 @@ OK (1 test, 1 assertions)
144131

145132
{% endhighlight %}
146133

147-
This simple test can be extended to a complete scenario of site usage.
148-
So by emulating the user's actions you can test any of your websites.
134+
That was a very simple test that you can reproduce for your own website.
135+
By emulating the user's actions you can test all of your websites the same way.
149136

150137
Give it a try!
151138

152-
## Bootstrap
153-
154-
Each suite has its own bootstrap file. It's located in the suite directory and is named `_bootstrap.php`. It will be executed before test suite. There is also a global bootstrap file located in the `tests` directory. It can be used to include additional files.
155-
156-
## Cept, Cest and Test Formats
157-
158-
Codeception supports three test formats. Beside the previously described scenario-based Cept format, Codeception can also execute [PHPUnit test files for unit testing](http://codeception.com/docs/06-UnitTests), and Cest format.
159-
160-
Cest combines scenario-driven test approach with OOP design. In case you want to group a few testing scenarios into one you should consider using Cest format. In the example below we are testing CRUD actions within a single file but with a several test (one per each operation):
161-
162-
{% highlight php %}
163-
164-
<?php
165-
class PageCrudCest
166-
{
167-
function _before(AcceptanceTester $I)
168-
{
169-
// will be executed at the beginning of each test
170-
$I->amOnPage('/');
171-
}
172-
173-
function createPage(AcceptanceTester $I)
174-
{
175-
// todo: write test
176-
}
177-
178-
function viewPage(AcceptanceTester $I)
179-
{
180-
// todo: write test
181-
}
182-
183-
function updatePage(AcceptanceTester $I)
184-
{
185-
// todo: write test
186-
}
187-
188-
function deletePage(AcceptanceTester $I)
189-
{
190-
// todo: write test
191-
}
192-
}
193-
?>
194-
195-
{% endhighlight %}
139+
## Modules and Helpers
196140

197-
Such Cest file can be created by running a generator:
141+
The actions in Actor classes are taken from modules. Generated Actor classes emulate multiple inheritance. Modules are designed to have one action performed with one method. According to the [DRY principle](http://en.wikipedia.org/wiki/Don%27t_repeat_yourself), if you use the same scenario components in different modules, you can combine them and move them to a custom module. By default each suite has an empty module, which can be used to extend Actor classes. They are stored in the __support__ directory.
198142

199-
{% highlight bash %}
143+
## Bootstrap
200144

201-
$ php codecept.phar generate:cest acceptance PageCrud
145+
Each suite has its own bootstrap file. It's located in the suite directory and is named `_bootstrap.php`. It will be executed before test suite. There is also a global bootstrap file located in the `tests` directory. It can be used to include additional files.
202146

203-
{% endhighlight %}
147+
## Test Formats
204148

205-
Learn more about [Cest format](http://codeception.com/docs/07-AdvancedUsage#Cest-Classes) in Advanced Testing section.
149+
Codeception supports three test formats. Beside the previously described scenario-based Cept format, Codeception can also execute [PHPUnit test files for unit testing](http://codeception.com/docs/06-UnitTests), and [class-based Cest](http://codeception.com/docs/07-AdvancedUsage#Cest-Classes) format. They are covered in later chapters. There is no difference in the way the tests of either format will be run in the suite.
206150

207151
## Configuration
208152

209153
Codeception has a global configuration in `codeception.yml` and a config for each suite. We also support `.dist` configuration files. If you have several developers in a project, put shared settings into `codeception.dist.yml` and personal settings into `codeception.yml`. The same goes for suite configs. For example, the `unit.suite.yml` will be merged with `unit.suite.dist.yml`.
210154

155+
211156
## Running Tests
212157

213158
Tests can be started with the `run` command.
@@ -306,5 +251,5 @@ We took a look into the Codeception structure. Most of the things you need were
306251

307252

308253

309-
* **Next Chapter: [AcceptanceTests >](/docs/03-AcceptanceTests)**
310-
* **Previous Chapter: [< Introduction](/docs/01-Introduction)**
254+
* **Next Chapter: [ModulesAndHelpers >](/docs/03-ModulesAndHelpers)**
255+
* **Previous Chapter: [< Introduction](/docs/01-Introduction)**<p>&nbsp;</p><div class="alert alert-warning">Docs are incomplete? Outdated? Or you just found a typo? <a href="https://github.com/Codeception/Codeception/tree/2.0/docs">Help us to improve documentation. Edit it on GitHub</a></div>

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy