Skip to content

Commit 2e774c3

Browse files
committed
auto updated documentation
1 parent 2b62479 commit 2e774c3

26 files changed

+1523
-138
lines changed

_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/Phalcon2">Phalcon2</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/Doctrine2">Doctrine2</a></li><li><a href="/docs/modules/SOAP">SOAP</a></li><li><a href="/docs/modules/FTP">FTP</a></li><li><a href="/docs/modules/Sequence">Sequence</a></li><li><a href="/docs/modules/Facebook">Facebook</a></li><li><a href="/docs/modules/Silex">Silex</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/Laravel4">Laravel4</a></li><li><a href="/docs/modules/WebDriver">WebDriver</a></li><li><a href="/docs/modules/Laravel5">Laravel5</a></li><li><a href="/docs/modules/XMLRPC">XMLRPC</a></li><li><a href="/docs/modules/Lumen">Lumen</a></li><li><a href="/docs/modules/Yii1">Yii1</a></li><li><a href="/docs/modules/Memcache">Memcache</a></li><li><a href="/docs/modules/Yii2">Yii2</a></li><li><a href="/docs/modules/MongoDb">MongoDb</a></li><li><a href="/docs/modules/ZF1">ZF1</a></li><li><a href="/docs/modules/Phalcon1">Phalcon1</a></li><li><a href="/docs/modules/ZF2">ZF2</a></li>

changelog.markdown

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,42 @@ title: Codeception Changelog
77

88
# Changelog
99

10+
#### 2.1.2
11+
12+
* **Updated to PHPUnit 4.8**
13+
* Enhancement: **Wildcard includes enabled when testing [multiple applications](http://codeception.com/docs/08-Customization#One-Runner-for-Multiple-Applications)**. See <a href="https://github.com/Codeception/Codeception/issues/2016">#2016</a> By <strong><a href="https://github.com/nzod">@nzod</a></strong>
14+
* <strong>[Symfony2]</strong> fixed Doctrine2 integration: Doctrine transactions will start before each test and rollback afterwards. *2015-08-08*
15+
* <strong>[Doctrine2]</strong> establishing connection and starting transaction is moved to `_before`. *2015-08-08*
16+
* <strong>[PhpBrowser]</strong> Removed disabled and file fields from form values. By <strong><a href="https://github.com/Naktibalda">@Naktibalda</a></strong> *2015-08-08*
17+
* <strong>[ZF2]</strong> Added grabServiceFromContainer function. By InVeX *2015-08-08*
18+
* <strong>[PhpBrowser]</strong><strong>[Guzzle6]</strong> Disabled strict mode of CookieJar <a href="https://github.com/Codeception/Codeception/issues/2234">#2234</a> By <strong><a href="https://github.com/Naktibalda">@Naktibalda</a></strong> *2015-08-04*
19+
* <strong>[Laravel5]</strong> Added `disableMiddleware()` and `enableMiddleware()` methods. By <strong><a href="https://github.com/janhenkgerritsen">@janhenkgerritsen</a></strong> *2015-08-07*
20+
* Enhancement: If a specific *ActorActions trait does not exist in `tests/_support/_generated` directory, it will be created automatically before run.
21+
* Enhancement: do not execute all included suites if you run one specific suite *2015-08-08*
22+
* `Extension\Recorder` navigate over slides with left and right arrow keys, do not create screenshots for comment steps.
23+
* `Extension\Recorder` generates index html for all saved records.
24+
* `Extension\Recorder` fixed for creating directories twice. Fixed <a href="https://github.com/Codeception/Codeception/issues/2216">#2216</a>
25+
* `Extension\Logger` fixed <a href="https://github.com/Codeception/Codeception/issues/2216">#2216</a>
26+
* Fixed injection of Helpers into Cest and Test files. See <a href="https://github.com/Codeception/Codeception/issues/2222">#2222</a>
27+
* `Stub::makeEmpty` on interfaces works again by <strong><a href="https://github.com/Naktibalda">@Naktibalda</a></strong>
28+
* Command `generate:scenarios` fixed for Cest files by <strong><a href="https://github.com/mkudenko">@mkudenko</a></strong> See <a href="https://github.com/Codeception/Codeception/issues/1962">#1962</a>
29+
* <strong>[Db]</strong> Quoted table name in Db::select, removed identical methods from child classes by <strong><a href="https://github.com/Naktibalda">@Naktibalda</a></strong>. See <a href="https://github.com/Codeception/Codeception/issues/2231">#2231</a>
30+
* <strong>[WebDriver]</strong> added support for running tests on a remote server behind a proxy with `http_proxy` and `http_proxy_port` config options by <strong><a href="https://github.com/jdq22">@jdq22</a></strong> *2015-07-29*
31+
* <strong>[Laravel]</strong> Fixed issue with error handling for `haveRecord()` method in Laravel modules <a href="https://github.com/Codeception/Codeception/issues/2217">#2217</a> by <strong><a href="https://github.com/janhenkgerritsen">@janhenkgerritsen</a></strong> *2015-07-28*
32+
* Fixed displayed XML/HTML report path <a href="https://github.com/Codeception/Codeception/issues/2187">#2187</a> by <strong><a href="https://github.com/Naktibalda">@Naktibalda</a></strong> *2015-07-27*
33+
* <strong>[WebDriver]</strong> Fixed `waitForElementChange` fatal error by <strong><a href="https://github.com/stipsan">@stipsan</a></strong>
34+
* <strong>[Db]</strong> Enhanced dollar quoting ($$) processing in PostgreSQL driver by <strong><a href="https://github.com/YasserHassan">@YasserHassan</a></strong> *2015-07-20*
35+
* <strong>[REST]</strong> Created tests for file-upload with REST module. By <strong><a href="https://github.com/Naktibalda">@Naktibalda</a></strong> *2015-08-08*
36+
* <strong>[Lumen]</strong> Fixed issue where wrong request object was passed to the Lumen application by <strong><a href="https://github.com/janhenkgerritsen">@janhenkgerritsen</a></strong> *2015-07-18*
37+
1038
#### 2.1.1
1139

1240
* <strong>[WebDriver]</strong> **Upgraded to facebook/webdriver 1.0** *2015-07-11*
1341
WebDriver classes were moved to `Facebook\WebDriver` namespace. Please take that into account when using WebDriver API directly.
1442
Till 2.2 Codeception will keep non-namespaced aliases of WebDriver classes.
1543
* Module Reference now contains documentation for hidden API methods which should be used in Helper classes
16-
* Skipped and Incomplete tests won't fire `test.before` and `test.after` events. For instance, WebDriver browser with won't be started and Db cleanups won't be executed on skipped tests.
17-
* Annotations <pre>@skip</pre> and <pre>@incomplete</pre> enabled in Cest files <a href="https://github.com/Codeception/Codeception/issues/2131">#2131</a>
44+
* Skipped and Incomplete tests won't fire `test.before` and `test.after` events. For instance, WebDriver browser won't be started and Db cleanups won't be executed on incomplete or skipped tests.
45+
* Annotations `skip` and `incomplete` enabled in Cest files <a href="https://github.com/Codeception/Codeception/issues/2131">#2131</a>
1846
* <strong>[WebDriver]</strong><strong>[PhpBrowser]</strong><strong>[Frameworks]</strong> `_findElements($locator)` method added to use in Helper classes *2015-07-11*
1947
Now you can use `$this->getModule('WebDriver')->findElements('.user');` in Helpers to match all elements with `user` class using WebDriver module
2048
* <strong>[PhpBrowser]</strong> Fixed `amOnUrl` method to open absolute URLs.
@@ -415,3 +443,4 @@ settings:
415443
* added extension to rerun failed tests
416444
* webdriver upgraded to 0.4
417445
* upgraded to PHPUnit 4
446+

docs/02-GettingStarted.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ 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+
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 testing 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:
1515

1616
{% highlight yaml %}
1717

docs/06-ReusingTestCode.md

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -273,11 +273,16 @@ But let's move further. A PageObject concept also defines that methods for the p
273273
{% highlight php %}
274274

275275
<?php
276-
class UserLoginPage
276+
namespace Page;
277+
278+
class Login
277279
{
278-
// include url of current page
279280
public static $URL = '/login';
280281
282+
public static $usernameField = '#mainForm #username';
283+
public static $passwordField = '#mainForm input[name=password]';
284+
public static $loginButton = '#mainForm input[type=submit]';
285+
281286
/**
282287
* @var AcceptanceTester
283288
*/
@@ -293,9 +298,9 @@ class UserLoginPage
293298
$I = $this->tester;
294299

295300
$I->amOnPage(self::$URL);
296-
$I->fillField(LoginPage::$usernameField, $name);
297-
$I->fillField(LoginPage::$passwordField, $password);
298-
$I->click(LoginPage::$loginButton);
301+
$I->fillField(self::$usernameField, $name);
302+
$I->fillField(self::$passwordField, $password);
303+
$I->click(self::$loginButton);
299304

300305
return $this;
301306
}
@@ -309,8 +314,10 @@ And here is an example of how this PageObject can be used in a test.
309314
{% highlight php %}
310315

311316
<?php
317+
use Page\Login as LoginPage;
318+
312319
$I = new AcceptanceTester($scenario);
313-
$loginPage = new \Page\Login($I);
320+
$loginPage = new LoginPage($I);
314321
$loginPage->login('bill evans', 'debby');
315322
$I->amOnPage('/profile');
316323
$I->see('Bill Evans Profile', 'h1');

docs/08-Customization.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Place `codeception.yml` file into root folder of your project and specify paths
1717
{% highlight yaml %}
1818

1919
include:
20-
- frontend
20+
- frontend/src/*Bundle
2121
- admin
2222
- api/rest
2323
paths:
@@ -27,8 +27,13 @@ settings:
2727

2828
{% endhighlight %}
2929

30+
3031
You should also specify path to `log` directory, where the reports and logs will be stored.
3132

33+
<div class="alert alert-notice">
34+
Wildcards (*) can be used to specify multiple directories at once.
35+
</div>
36+
3237
### Namespaces
3338

3439
To avoid naming conflicts between Actor classes and Helper classes, they should be added into namespaces.

docs/10-WebServices.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ Configure modules in `api.suite.yml`:
2828
class_name: ApiTester
2929
modules:
3030
enabled:
31-
- REST:
32-
url: http://serviceapp/api/v1/
33-
depends: PhpBrowser
31+
- REST:
32+
url: http://serviceapp/api/v1/
33+
depends: PhpBrowser
3434

3535
{% endhighlight %}
3636

@@ -41,10 +41,10 @@ The REST module will connect to `PhpBrowser` according to this configuration. De
4141
class_name: ApiTester
4242
modules:
4343
enabled:
44-
- REST:
45-
url: http://serviceapp/api/v1/
46-
depends: PhpBrowser
47-
part: Json
44+
- REST:
45+
url: http://serviceapp/api/v1/
46+
depends: PhpBrowser
47+
part: Json
4848

4949
{% endhighlight %}
5050

@@ -56,9 +56,9 @@ API tests can be functional and be executed using Symfony2, Laravel4, Laravel5,
5656
class_name: ApiTester
5757
modules:
5858
enabled:
59-
- REST:
60-
url: /api/v1/
61-
depends: Laravel5
59+
- REST:
60+
url: /api/v1/
61+
depends: Laravel5
6262

6363
{% endhighlight %}
6464

@@ -191,9 +191,9 @@ Let's configure `SOAP` module to be used with `PhpBrowser`:
191191
class_name: ApiTester
192192
modules:
193193
enabled:
194-
- SOAP:
195-
depends: PhpBrowser
196-
endpoint: http://serviceapp/api/v1/
194+
- SOAP:
195+
depends: PhpBrowser
196+
endpoint: http://serviceapp/api/v1/
197197

198198
{% endhighlight %}
199199

docs/modules/Asserts.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ Checks if file exists
5959

6060
#### assertFileNotExists
6161

62-
Checks if file doesn't exists
62+
Checks if file doesn't exist
6363

6464
* `param string` $filename
6565
* `param string` $message

docs/modules/Db.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,24 @@ Check out drivers if you get problems loading dumps and cleaning databases.
7272
cleanup: false
7373
reconnect: true
7474

75+
#### SQL data dump
76+
77+
* Comments are permitted.
78+
* The `dump.sql` may contain multiline statements.
79+
* The delimiter, a semi-colon in this case, must be on the same line as the last statement:
80+
81+
{% highlight sql %}
82+
83+
-- Add a few contacts to the table.
84+
REPLACE INTO `Contacts` (`created`, `modified`, `status`, `contact`, `first`, `last`) VALUES
85+
(NOW(), NOW(), 1, 'Bob Ross', 'Bob', 'Ross'),
86+
(NOW(), NOW(), 1, 'Fred Flintstone', 'Fred', 'Flintstone');
87+
88+
-- Remove existing orders for testing.
89+
DELETE FROM `Order`;
90+
91+
{% endhighlight %}
92+
7593
### Public Properties
7694
* dbh - contains PDO connection.
7795
* driver - contains Connection Driver. See [list all available drivers](https://github.com/Codeception/Codeception/tree/master/src/Codeception/Util/Driver)

docs/modules/Doctrine2.md

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,37 @@ title: Codeception - Documentation
1111

1212

1313
Allows integration and testing for projects with Doctrine2 ORM.
14-
1514
Doctrine2 uses EntityManager to perform all database operations.
16-
As the module uses active connection and active entity manager, instance of this object should be passed to this module.
1715

18-
It can be done in bootstrap file, by setting static $em property:
16+
When using with Zend Framework 2 or Symfony2 Doctrine connection is automatically retrieved from Service Locator.
17+
In this case you should include either **Symfony2** or **ZF2** module and specify it as dependent for Doctrine:
1918

20-
{% highlight php %}
19+
{% highlight yaml %}
20+
modules:
21+
enabled:
22+
- Symfony2
23+
- Doctrine2:
24+
depends: Symfony2
2125

22-
<?php
26+
{% endhighlight %}
2327

24-
\Codeception\Module\Doctrine2::$em = $em
28+
If you don't use any of frameworks above, you should specify a callback function to receive entity manager:
29+
30+
{% highlight yaml %}
31+
modules:
32+
enabled:
33+
- Doctrine2:
34+
connection_callback: ['MyDb', 'createEntityManager']
2535

2636

2737
{% endhighlight %}
38+
39+
This will use static method of `MyDb::createEntityManager()` to establish EntityManager.
40+
41+
By default module will wrap everything into transaction for each test and rollback it afterwards. By doing this
42+
tests won't write anything to database, and so will run much faster and will be isolate dfrom each other.
43+
This behavior can be changed by specifying `cleanup: false` in config.
44+
2845
### Status
2946

3047
* Maintainer: **davert**
@@ -33,7 +50,6 @@ It can be done in bootstrap file, by setting static $em property:
3350

3451
### Config
3552

36-
* auto_connect: true - tries to get EntityManager through connected frameworks. If none found expects the $em values specified as described above.
3753
* cleanup: true - all doctrine queries will be run in transaction, which will be rolled back at the end of test.
3854
* connection_callback: - callable that will return an instance of EntityManager. This is a must if you run Doctrine without Zend2 or Symfony2 frameworks
3955

docs/modules/FTP.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,15 +163,15 @@ Deletes a file
163163

164164
#### dontSeeFileFound
165165

166-
Checks if file does not exists in path on the remote FTP/SFTP system
166+
Checks if file does not exist in path on the remote FTP/SFTP system
167167

168168
* `param` $filename
169169
* `param string` $path
170170

171171

172172
#### dontSeeFileFoundMatches
173173

174-
Checks if file does not exists in path on the remote FTP/SFTP system, using regular expression as filename.
174+
Checks if file does not exist in path on the remote FTP/SFTP system, using regular expression as filename.
175175
DOES NOT OPEN the file when it's exists
176176

177177
* `param` $regex

0 commit comments

Comments
 (0)