Skip to content

Commit 568eb96

Browse files
committed
auto updated documentation
1 parent 85f24e5 commit 568eb96

28 files changed

Lines changed: 348 additions & 243 deletions

_includes/extensions.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@ extensions:
4747
#### Configuration
4848

4949
* `delete_successful` (default: true) - delete records for successfully passed tests (log only failed and errored)
50-
* `module` (default: WebDriver) - which module for screenshots to use. Module should implement `Codeception\Lib\Interfaces\ScreenshotSaver` interaface. Currently only WebDriver or any its children can be used.
50+
* `module` (default: WebDriver) - which module for screenshots to use.
51+
Module should implement `Codeception\Lib\Interfaces\ScreenshotSaver` interface.
52+
Currently only WebDriver or any its children can be used.
5153

5254
``` yaml
5355
extensions:

changelog.markdown

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,30 @@ title: Codeception Changelog
77

88
# Changelog
99

10+
#### 2.1.9
11+
12+
* PHPUnit 5.4 compatibility for creating mocks using `Codeception\Util\Stub` by <strong><a href="https://github.com/davertmik">@davertmik</a></strong>. See <a href="https://github.com/Codeception/Codeception/issues/3093">#3093</a> and <a href="https://github.com/Codeception/Codeception/issues/3080">#3080</a>
13+
* Updated dependencies to support Symfony 3.1
14+
* Added `settings: backup_global` to config, to disable backup_global option of PHPUnit by <strong><a href="https://github.com/mkeasling">@mkeasling</a></strong>. See <a href="https://github.com/Codeception/Codeception/issues/3045">#3045</a>. Fixes <a href="https://github.com/Codeception/Codeception/issues/3044">#3044</a>
15+
* <strong>[PhpBrowser]</strong><strong>[Frameworks]</strong> `see` matches UTF-8 text case-insensitively by <strong><a href="https://github.com/Naktibalda">@Naktibalda</a></strong>. Fixes <a href="https://github.com/Codeception/Codeception/issues/3114">#3114</a>
16+
* Fixed page object generation with namespaces by <strong><a href="https://github.com/eugene">@eugene</a></strong>-manuilov and <strong><a href="https://github.com/Naktibalda">@Naktibalda</a></strong>. See <a href="https://github.com/Codeception/Codeception/issues/3126">#3126</a> Fixes <a href="https://github.com/Codeception/Codeception/issues/3012">#3012</a>
17+
* `--steps` will not disable code coverage. By <strong><a href="https://github.com/Naktibalda">@Naktibalda</a></strong>. Fixes <a href="https://github.com/Codeception/Codeception/issues/2620">#2620</a>
18+
* Suppress console coverage report with `--quiet` by <strong><a href="https://github.com/EspadaV8">@EspadaV8</a></strong>. See <a href="https://github.com/Codeception/Codeception/issues/2370">#2370</a>
19+
* Improved multibyte output in console by <strong><a href="https://github.com/kt81">@kt81</a></strong>. See <a href="https://github.com/Codeception/Codeception/issues/3130">#3130</a>
20+
* <strong>[Lumen]</strong> Fixed: `initializeLumen()` method has been called twice on start by <strong><a href="https://github.com/kt81">@kt81</a></strong>. See <a href="https://github.com/Codeception/Codeception/issues/3124">#3124</a> <a href="https://github.com/Codeception/Codeception/issues/2607">#2607</a>
21+
* <strong>[Db]</strong> Allow INT Parameter SQL Binding by <strong><a href="https://github.com/davidcochrum">@davidcochrum</a></strong> . Fixes <a href="https://github.com/Codeception/Codeception/issues/3118">#3118</a>
22+
* <strong>[Db]</strong> Support LIKE conditions in assertions.
23+
* <strong>[Db]</strong> Improved regex for parsing comments by <strong><a href="https://github.com/dima">@dima</a></strong>-stefantsov. See <a href="https://github.com/Codeception/Codeception/issues/3138">#3138</a>
24+
* <strong>[Dbh]</strong> Fix `seeInDatabase` and `dontSeeInDatabase` with empty criteria. Closes <a href="https://github.com/Codeception/Codeception/issues/3116">#3116</a>
25+
* <strong>[Symfony]</strong> Improve fail messages on seeInCurrentRoute and seeCurrentRouteIs
26+
* <strong>[Symfony]</strong> Improve route comparison on seeInCurrentRoute and seeCurrentRouteIs
27+
* <strong>[WebDriver]</strong> multi session testing with friends improved by <strong><a href="https://github.com/eXorus">@eXorus</a></strong>. Webdriver sessions are finished correctly; `leave()` method added to Friend class. See <a href="https://github.com/Codeception/Codeception/issues/3068">#3068</a>
28+
* <strong>[PhpBrowser]</strong> added `handler` and `middleware` config options to customize Guzzle handlers and middleware
29+
* Added full support of phpunit-bridge features.
30+
* <strong>[Laravel]</strong> Fixed issue where non-existing services were called in _before and _after methods. See <a href="https://github.com/Codeception/Codeception/issues/3028">#3028</a>.
31+
* <strong>[WebDriver]</strong> fixed using `saveSessionSnapshot` with codecoverage. Closes <a href="https://github.com/Codeception/Codeception/issues/2923">#2923</a>
32+
* <strong>[ZF2]</strong> create new instance of Application for each request
33+
1034
#### 2.1.8
1135

1236
* `Util\Locator` added methods to create locators to match element at their position: `elementAt`, `firstElement`, `lastElement`

docs/03-AcceptanceTests.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -517,6 +517,21 @@ $I->see('Hello all!', '.message');
517517

518518
In this case we did some actions in second window with `does` command on a friend object.
519519

520+
Sometimes you may want to close a web page before the end of the test. For such cases you may use leave(). You can also specify roles for friend :
521+
{% highlight php %}
522+
523+
<?php
524+
525+
$nickAdmin = $I->haveFriend('nickAdmin', adminStep::class);
526+
$nickAdmin->does(function(adminStep $I) {
527+
// Admin does ...
528+
});
529+
$nickAdmin->leave();
530+
?>
531+
532+
{% endhighlight %}
533+
534+
520535
### Cleaning Things Up
521536

522537
While testing, your actions may change the data on the site. Tests will fail if trying to create or update the same data twice. To avoid this problem, your database should be repopulated for each test. Codeception provides a `Db` module for that purpose. It will load a database dump after each passed test. To make repopulation work, create an sql dump of your database and put it into the __/tests/_data__ directory. Set the database connection and path to the dump in the global Codeception config.

docs/modules/Db.md

Lines changed: 50 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,18 @@ Supported but not tested.
3434
* Oracle
3535

3636
Connection is done by database Drivers, which are stored in the `Codeception\Lib\Driver` namespace.
37-
[Check out the drivers](https://github.com/Codeception/Codeception/tree/2.1/src/Codeception/Lib/Driver) if you run into problems loading dumps and cleaning databases.
37+
[Check out the drivers](https://github.com/Codeception/Codeception/tree/2.1/src/Codeception/Lib/Driver)
38+
if you run into problems loading dumps and cleaning databases.
3839

3940
### Status
4041

41-
* Maintainer: **davert**
42+
* Maintainer: **Gintautas Miselis**
4243
* stability:
4344
- Mysql: **stable**
4445
- SQLite: **stable**
4546
- Postgres: **beta**
4647
- MSSQL: **alpha**
4748
- Oracle: **alpha**
48-
* Contact: codecept@davert.mail.ua
4949

5050
*Please review the code of non-stable modules and provide patches if you have issues.*
5151

@@ -59,7 +59,7 @@ Connection is done by database Drivers, which are stored in the `Codeception\Lib
5959
* cleanup: true - whether the dump should be reloaded after each test
6060
* reconnect: false - whether the module should reconnect to the database before each test
6161

62-
#### Example
62+
### Example
6363

6464
modules:
6565
enabled:
@@ -72,12 +72,12 @@ Connection is done by database Drivers, which are stored in the `Codeception\Lib
7272
cleanup: false
7373
reconnect: true
7474

75-
#### SQL data dump
75+
### SQL data dump
7676

7777
* Comments are permitted.
7878
* The `dump.sql` may contain multiline statements.
7979
* The delimiter, a semi-colon in this case, must be on the same line as the last statement:
80-
80+
8181
{% highlight sql %}
8282

8383
-- Add a few contacts to the table.
@@ -89,7 +89,43 @@ REPLACE INTO `Contacts` (`created`, `modified`, `status`, `contact`, `first`, `l
8989
DELETE FROM `Order`;
9090

9191
{% endhighlight %}
92+
### Query generation
93+
94+
seeInDatabase, dontSeeInDatabase, seeNumRecords and grabFromDatabase methods accept arrays as criteria.
95+
WHERE condition is generated using item key as a field name and item value as a field value.
96+
97+
Example:
98+
{% highlight php %}
99+
100+
<?php
101+
$I->seeInDatabase('users', array('name' => 'Davert', 'email' => 'davert@mail.com'));
102+
103+
104+
{% endhighlight %}
105+
Will generate:
106+
107+
{% highlight sql %}
108+
109+
SELECT COUNT(*) FROM `users` WHERE `name` = 'Davert' AND `email` = 'davert@mail.com'
110+
111+
{% endhighlight %}
112+
New addition to 2.1.9 is ability to use LIKE in condition. It is achieved by adding ' like' to column name.
113+
114+
Example:
115+
{% highlight php %}
116+
117+
<?php
118+
$I->seeInDatabase('users', array('name' => 'Davert', 'email like' => 'davert%'));
119+
120+
121+
{% endhighlight %}
122+
Will generate:
92123

124+
{% highlight sql %}
125+
126+
SELECT COUNT(*) FROM `users` WHERE `name` = 'Davert' AND `email` LIKE 'davert%'
127+
128+
{% endhighlight %}
93129
### Public Properties
94130
* dbh - contains the PDO connection
95131
* driver - contains the Connection Driver
@@ -103,25 +139,15 @@ Effect is opposite to ->seeInDatabase
103139
Asserts that there is no record with the given column values in a database.
104140
Provide table name and column values.
105141

106-
Example:
107-
108142
{% highlight php %}
109143

110144
<?php
111145
$I->dontSeeInDatabase('users', array('name' => 'Davert', 'email' => 'davert * `mail.com'));`
112146

113-
114-
{% endhighlight %}
115-
Will generate:
116-
117-
{% highlight sql %}
118-
119-
SELECT COUNT(*) FROM `users` WHERE `name` = 'Davert' AND `email` = 'davert * `mail.com'`
120-
121147
{% endhighlight %}
122148
Fails if such user was found.
123149

124-
* `param` $table
150+
* `param string` $table
125151
* `param array` $criteria
126152

127153

@@ -130,20 +156,15 @@ Fails if such user was found.
130156
Fetches a single column value from a database.
131157
Provide table name, desired column and criteria.
132158

133-
Example:
134-
135159
{% highlight php %}
136160

137161
<?php
138162
$mail = $I->grabFromDatabase('users', 'email', array('name' => 'Davert'));
139163

140-
141164
{% endhighlight %}
142165

143-
* `Available since` 1.1
144-
145-
* `param` $table
146-
* `param` $column
166+
* `param string` $table
167+
* `param string` $column
147168
* `param array` $criteria
148169

149170

@@ -160,7 +181,7 @@ $I->haveInDatabase('users', array('name' => 'miles', 'email' => 'miles * `davis.
160181

161182
{% endhighlight %}
162183

163-
* `param` $table
184+
* `param string` $table
164185
* `param array` $data
165186

166187
* `return integer` $id
@@ -171,25 +192,15 @@ $I->haveInDatabase('users', array('name' => 'miles', 'email' => 'miles * `davis.
171192
Asserts that a row with the given column values exists.
172193
Provide table name and column values.
173194

174-
Example:
175-
176195
{% highlight php %}
177196

178197
<?php
179198
$I->seeInDatabase('users', array('name' => 'Davert', 'email' => 'davert * `mail.com'));`
180199

181-
182-
{% endhighlight %}
183-
Will generate:
184-
185-
{% highlight sql %}
186-
187-
SELECT COUNT(*) FROM `users` WHERE `name` = 'Davert' AND `email` = 'davert * `mail.com'`
188-
189200
{% endhighlight %}
190201
Fails if no such user found.
191202

192-
* `param` $table
203+
* `param string` $table
193204
* `param array` $criteria
194205

195206

@@ -205,8 +216,8 @@ $I->seeNumRecords(1, 'users', ['name' => 'davert'])
205216

206217
{% endhighlight %}
207218

208-
* `param int` $expectedNumber Expected number
209-
* `param string` $table Table name
210-
* `param array` $criteria Search criteria [Optional]
219+
* `param int` $expectedNumber Expected number
220+
* `param string` $table Table name
221+
* `param array` $criteria Search criteria [Optional]
211222

212223
<p>&nbsp;</p><div class="alert alert-warning">Module reference is taken from the source code. <a href="https://github.com/Codeception/Codeception/tree/2.1/src/Codeception/Module/Db.php">Help us to improve documentation. Edit module reference</a></div>

docs/modules/Dbh.md

Lines changed: 6 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ Otherwise consider using ORMs like Doctrine, that emulate nested transactions, o
3737
* Stability: **stable**
3838
* Contact: codecept@davert.mail.ua
3939

40-
This module despite of it's stability may act unstable because of transactions issue. If test fails with fatal error and transaction is not finished, it may affect other transactions.
40+
This module despite of it's stability may act unstable because of transactions issue.
41+
If test fails with fatal error and transaction is not finished, it may affect other transactions.
4142

4243
*Please review the code of non-stable modules and provide patches if you have issues.*
4344

@@ -62,25 +63,15 @@ Effect is opposite to ->seeInDatabase
6263
Asserts that there is no record with the given column values in a database.
6364
Provide table name and column values.
6465

65-
Example:
66-
6766
{% highlight php %}
6867

6968
<?php
7069
$I->dontSeeInDatabase('users', array('name' => 'Davert', 'email' => 'davert * `mail.com'));`
7170

72-
73-
{% endhighlight %}
74-
Will generate:
75-
76-
{% highlight sql %}
77-
78-
SELECT COUNT(*) FROM `users` WHERE `name` = 'Davert' AND `email` = 'davert * `mail.com'`
79-
8071
{% endhighlight %}
8172
Fails if such user was found.
8273

83-
* `param` $table
74+
* `param string` $table
8475
* `param array` $criteria
8576

8677

@@ -89,20 +80,15 @@ Fails if such user was found.
8980
Fetches a single column value from a database.
9081
Provide table name, desired column and criteria.
9182

92-
Example:
93-
9483
{% highlight php %}
9584

9685
<?php
9786
$mail = $I->grabFromDatabase('users', 'email', array('name' => 'Davert'));
9887

99-
10088
{% endhighlight %}
10189

102-
* `Available since` 1.1
103-
104-
* `param` $table
105-
* `param` $column
90+
* `param string` $table
91+
* `param string` $column
10692
* `param array` $criteria
10793

10894

@@ -112,25 +98,15 @@ $mail = $I->grabFromDatabase('users', 'email', array('name' => 'Davert'));
11298
Asserts that a row with the given column values exists.
11399
Provide table name and column values.
114100

115-
Example:
116-
117101
{% highlight php %}
118102

119103
<?php
120104
$I->seeInDatabase('users', array('name' => 'Davert', 'email' => 'davert * `mail.com'));`
121105

122-
123-
{% endhighlight %}
124-
Will generate:
125-
126-
{% highlight sql %}
127-
128-
SELECT COUNT(*) FROM `users` WHERE `name` = 'Davert' AND `email` = 'davert * `mail.com'`
129-
130106
{% endhighlight %}
131107
Fails if no such user found.
132108

133-
* `param` $table
109+
* `param string` $table
134110
* `param array` $criteria
135111

136112
<p>&nbsp;</p><div class="alert alert-warning">Module reference is taken from the source code. <a href="https://github.com/Codeception/Codeception/tree/2.1/src/Codeception/Module/Dbh.php">Help us to improve documentation. Edit module reference</a></div>

docs/modules/Doctrine2.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,8 @@ $I->haveFakeRepository('Entity\User', array('findByUsername' => function($userna
120120

121121
{% endhighlight %}
122122

123-
This creates a stub class for Entity\User repository with redefined method findByUsername, which will always return the NULL value.
123+
This creates a stub class for Entity\User repository with redefined method findByUsername,
124+
which will always return the NULL value.
124125

125126
* `param` $classname
126127
* `param array` $methods

docs/modules/FTP.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ Supported and tested FTP types are:
2727
* FTP
2828
* SFTP
2929

30-
Connection uses php build in FTP client for FTP, connection to SFTP uses [phpseclib](http://phpseclib.sourceforge.net/) pulled in using composer.
30+
Connection uses php build in FTP client for FTP,
31+
connection to SFTP uses [phpseclib](http://phpseclib.sourceforge.net/) pulled in using composer.
3132

3233
For SFTP, add [phpseclib](http://phpseclib.sourceforge.net/) to require list.
3334
{% highlight yaml %}
@@ -315,7 +316,8 @@ $I->makeDir('vendor');
315316

316317
#### openFile
317318

318-
Opens a file (downloads from the remote FTP/SFTP system to a tmp directory for processing) and stores it's content.
319+
Opens a file (downloads from the remote FTP/SFTP system to a tmp directory for processing)
320+
and stores it's content.
319321

320322
Usage:
321323

0 commit comments

Comments
 (0)