Skip to content

Commit 2d69f5a

Browse files
committed
auto updated documentation
1 parent 3159aef commit 2d69f5a

22 files changed

+1962
-408
lines changed

changelog.markdown

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

88
# Changelog
99

10+
#### 2.1.4
11+
12+
* <strong>[PhpBrowser]</strong><strong>[Frameworks]</strong> Added `_getResponseContent` hidden method. By <strong><a href="https://github.com/Naktibalda">@Naktibalda</a></strong>
13+
* <strong>[PhpBrowser]</strong><strong>[Frameworks]</strong> Added `moveBack` method. By <strong><a href="https://github.com/Naktibalda">@Naktibalda</a></strong>
14+
* <strong>[WebDriver]</strong><strong>[PhpBrowser]</strong><strong>[Frameworks]</strong> Added `seeInSource`, `dontSeeInSource` methods to check raw HTML instead of stripped text in `see`/`dontSee`. By <strong><a href="https://github.com/zbateson">@zbateson</a></strong> in <a href="https://github.com/Codeception/Codeception/issues/2465">#2465</a>
15+
* <strong>[WebDriver]</strong> print Selenium WebDriver logs on failure or manually with `debugWebDriverLogs` in debug mode. Config option `debug_log_entries` added. See <a href="https://github.com/Codeception/Codeception/issues/2471">#2471</a> By <strong><a href="https://github.com/MasonM">@MasonM</a></strong> and <strong><a href="https://github.com/DavertMik">@DavertMik</a></strong>.
16+
* <strong>[ZF2]</strong> grabs service from container without reinitializing it. Fixes <a href="https://github.com/Codeception/Codeception/issues/2519">#2519</a> where Doctrine2 gets different instances of the entity manager everytime grabServiceFromContainer is called. By <strong><a href="https://github.com/dranzd">@dranzd</a></strong>
17+
* <strong>[REST]</strong> fixed usage of JsonArray and `json_last_error_msg` function on PHP 5.4. See <a href="https://github.com/Codeception/Codeception/issues/2535">#2535</a>. By <strong><a href="https://github.com/Naktibalda">@Naktibalda</a></strong>
18+
* <strong>[REST]</strong> `seeResponseIsJsonType` can now validate emails with `string:email` definition. By <strong><a href="https://github.com/DavertMik">@DavertMik</a></strong>
19+
* <strong>[REST]</strong> `seeResponseIsJsonType`: `string|null` as well as `null|string` can be used to match null type. <a href="https://github.com/Codeception/Codeception/issues/2522">#2522</a> <a href="https://github.com/Codeception/Codeception/issues/2500">#2500</a> By <strong><a href="https://github.com/vslovik">@vslovik</a></strong>
20+
* <strong>[REST]</strong> REST methods can be used to inspect result of the last request made by PhpBrowser or framework module. see <a href="https://github.com/Codeception/Codeception/issues/2507">#2507</a>. By <strong><a href="https://github.com/Naktibalda">@Naktibalda</a></strong>
21+
* <strong>[Silex]</strong> Doctrine provider added. Doctrine2 module can be connected to Silex app with `depends: Silex` in config. By <strong><a href="https://github.com/arduanov">@arduanov</a></strong> <a href="https://github.com/Codeception/Codeception/issues/2503">#2503</a>
22+
* <strong>[Laravel5]</strong> Removed `expectEvents` and added `seeEventTriggered` and `dontSeeEventTriggered`. By <strong><a href="https://github.com/janhenkgerritsen">@janhenkgerritsen</a></strong>
23+
* <strong>[Laravel5]</strong> Fixed fatal error in `seeCurrentRouteIs` and `seeCurrentActionIs` methods. See <a href="https://github.com/Codeception/Codeception/issues/2517">#2517</a>. By <strong><a href="https://github.com/janhenkgerritsen">@janhenkgerritsen</a></strong>
24+
* <strong>[Laravel5]</strong> Improved the error messages for several methods. See <a href="https://github.com/Codeception/Codeception/issues/2476">#2476</a>. By <strong><a href="https://github.com/janhenkgerritsen">@janhenkgerritsen</a></strong>
25+
* <strong>[Laravel5]</strong> Improved form error methods. See <a href="https://github.com/Codeception/Codeception/issues/2432">#2432</a>. By <strong><a href="https://github.com/janhenkgerritsen">@janhenkgerritsen</a></strong>
26+
* <strong>[Laravel5]</strong> Added wrapper methods for Laravel 5 model factories. See <a href="https://github.com/Codeception/Codeception/issues/2442">#2442</a>. By <strong><a href="https://github.com/janhenkgerritsen">@janhenkgerritsen</a></strong>
27+
* <strong>[Phalcon]</strong> Added `amOnRoute` and `seeCurrentRouteIs` methods by <strong><a href="https://github.com/sergeyklay">@sergeyklay</a></strong>
28+
* <strong>[Phalcon]</strong> Added `seeSessionHasValues` by <strong><a href="https://github.com/sergeyklay">@sergeyklay</a></strong>
29+
* <strong>[Phalcon]</strong> Added `getApplication()` method by <strong><a href="https://github.com/sergeyklay">@sergeyklay</a></strong>
30+
* <strong>[Symfony2]</strong> Sets `xdebug.max_nesting_level` to 200 only if it is lower. Fixes error hiding <a href="https://github.com/Codeception/Codeception/issues/2462">#2462</a> by <strong><a href="https://github.com/mhightower">@mhightower</a></strong>
31+
* <strong>[Db]</strong> Save the search path when importing Postgres dumps <a href="https://github.com/Codeception/Codeception/issues/2441">#2441</a> by <strong><a href="https://github.com/EspadaV8">@EspadaV8</a></strong>
32+
* <strong>[Yii2]</strong> Fixed problems with transaction rollbacks when using the `cleanup` flag. See <a href="https://github.com/Codeception/Codeception/issues/2488">#2488</a>. By <strong><a href="https://github.com/ivokund">@ivokund</a></strong>
33+
* <strong>[Yii2]</strong> Clean up previously uploaded files between tests by <strong><a href="https://github.com/tibee">@tibee</a></strong>
34+
* Actor classes generation improved by <strong><a href="https://github.com/codemedic">@codemedic</a></strong> <a href="https://github.com/Codeception/Codeception/issues/2453">#2453</a>
35+
* Added support for nested helper by <strong><a href="https://github.com/luka">@luka</a></strong>-zitnik <a href="https://github.com/Codeception/Codeception/issues/2494">#2494</a>
36+
* Make `generate:suite` respect bootstrap setting in <a href="https://github.com/Codeception/Codeception/issues/2512">#2512</a>. By <strong><a href="https://github.com/dmitrivereshchagin">@dmitrivereshchagin</a></strong>
37+
1038
#### 2.1.3
1139

1240
* <strong>[REST]</strong> **Added matching data types** by with new methods `seeResponseMatchesJsonType` and `dontSeeResponseMatchesJsonType`. See <a href="https://github.com/Codeception/Codeception/issues/2391">#2391</a>

docs/05-UnitTests.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -127,24 +127,26 @@ class UserTest extends \Codeception\TestCase\Test
127127
{
128128
use \Codeception\Specify;
129129
130+
private $user;
131+
130132
public function testValidation()
131133
{
132-
$user = User::create();
134+
$this->user = User::create();
133135

134136
$this->specify("username is required", function() {
135-
$user->username = null;
136-
$this->assertFalse($user->validate(['username']));
137+
$this->user->username = null;
138+
$this->assertFalse($this->user->validate(['username']));
137139
});
138140

139141
$this->specify("username is too long", function() {
140-
$user->username = 'toolooooongnaaaaaaameeee';
141-
$this->assertFalse($user->validate(['username']));
142+
$this->user->username = 'toolooooongnaaaaaaameeee';
143+
$this->assertFalse($this->user->validate(['username']));
142144
});
143145

144146
$this->specify("username is ok", function() {
145-
$user->username = 'davert';
146-
$this->assertTrue($user->validate(['username']));
147-
});
147+
$this->user->username = 'davert';
148+
$this->assertTrue($this->user->validate(['username']));
149+
});
148150
}
149151
}
150152
?>

docs/10-WebServices.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ $I->seeResponseContainsJson([
108108

109109
{% endhighlight %}
110110

111-
You may want to perform even more complex assertions on a response. This can be done by writing your own methods in the [Helper](http://codeception.com/docs/03-ModulesAndHelpers#Helpers) classes. To access the latest JSON response you will need to get the `response` property of the `REST` module. Let's demonstrate it with the `seeResponseIsHtml` method:
111+
You may want to perform even more complex assertions on a response. This can be done by writing your own methods in the [Helper](http://codeception.com/docs/06-ReusingTestCode#Modules-and-Helpers) classes. To access the latest JSON response you will need to get the `response` property of the `REST` module. Let's demonstrate it with the `seeResponseIsHtml` method:
112112

113113
{% highlight php %}
114114

@@ -147,6 +147,28 @@ $I->seeResponseJsonMatchesXpath('//user/login');
147147

148148
{% endhighlight %}
149149

150+
More detailed check can be applied if you need to validate the type of fields in a response.
151+
You can do that by using with a [seeResponseMatchesJsonType](http://codeception.com/docs/modules/REST#seeResponseMatchesJsonType) action in which you define the structure of JSON response.
152+
153+
{% highlight php %}
154+
155+
<?php
156+
$I->sendGET('/users/1');
157+
$I->seeResponseIsJson();
158+
$I->seeResponseMatchesJsonType([
159+
'id' => 'integer',
160+
'name' => 'string',
161+
'email' => 'string:email',
162+
'homepage' => 'string:url|null',
163+
'created_at' => 'string:date',
164+
'is_active' => 'boolean'
165+
]);
166+
?>
167+
168+
{% endhighlight %}
169+
170+
Codeception uses this simple and lightweight definitions format which can be [easily learned and extended](http://codeception.com/docs/modules/REST#seeResponseMatchesJsonType).
171+
150172
### Testing XML Responses
151173

152174
In case your REST API works with XML format you can use similar methods to test its data and structure.

docs/modules/Db.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ title: Db - Codeception - Documentation
1212

1313
Works with SQL database.
1414

15-
The most important function of this module is cleaning database before each test.
16-
That's why this module was added into global configuration file: codeception.yml.
15+
The most important function of this module is to clean a database before each test.
16+
That's why this module was added to the global configuration file `codeception.yml`.
1717
To have your database properly cleaned you should configure it to access the database.
18-
Also provides actions to perform checks in database.
18+
This module also provides actions to perform checks in a database.
1919

2020
In order to have your database populated with data you need a raw SQL dump.
21-
Just put it in `tests/_data` dir (by default) and specify path to it in config.
22-
Next time after database is cleared all your data will be restored from dump.
23-
Don't forget to include CREATE TABLE statements into it.
21+
Simply put the dump in the `tests/_data` directory (by default) and specify the path in the config.
22+
The next time after the database is cleared, all your data will be restored from the dump.
23+
Don't forget to include `CREATE TABLE` statements in the dump.
2424

2525
Supported and tested databases are:
2626

@@ -33,8 +33,8 @@ Supported but not tested.
3333
* MSSQL
3434
* Oracle
3535

36-
Connection is done by database Drivers, which are stored in Codeception\Lib\Driver namespace.
37-
Check out drivers if you get problems loading dumps and cleaning databases.
36+
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.
3838

3939
### Status
4040

@@ -54,10 +54,10 @@ Check out drivers if you get problems loading dumps and cleaning databases.
5454
* dsn *required* - PDO DSN
5555
* user *required* - user to access database
5656
* password *required* - password
57-
* dump - path to database dump.
58-
* populate: true - should the dump be loaded before test suite is started.
59-
* cleanup: true - should the dump be reloaded after each test
60-
* reconnect: false - should the module reconnect to database before each test
57+
* dump - path to database dump
58+
* populate: true - whether the the dump should be loaded before the test suite is started
59+
* cleanup: true - whether the dump should be reloaded after each test
60+
* reconnect: false - whether the module should reconnect to the database before each test
6161

6262
#### Example
6363

@@ -76,7 +76,7 @@ Check out drivers if you get problems loading dumps and cleaning databases.
7676

7777
* Comments are permitted.
7878
* 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:
79+
* The delimiter, a semi-colon in this case, must be on the same line as the last statement:
8080

8181
{% highlight sql %}
8282

@@ -91,16 +91,16 @@ DELETE FROM `Order`;
9191
{% endhighlight %}
9292

9393
### Public Properties
94-
* dbh - contains PDO connection.
95-
* driver - contains Connection Driver. See [list all available drivers](https://github.com/Codeception/Codeception/tree/master/src/Codeception/Util/Driver)
94+
* dbh - contains the PDO connection
95+
* driver - contains the Connection Driver
9696

9797

9898

9999
#### dontSeeInDatabase
100100

101101
Effect is opposite to ->seeInDatabase
102102

103-
Checks if there is no record with such column values in database.
103+
Asserts that there is no record with the given column values in a database.
104104
Provide table name and column values.
105105

106106
Example:
@@ -150,7 +150,7 @@ $mail = $I->grabFromDatabase('users', 'email', array('name' => 'Davert'));
150150

151151
#### haveInDatabase
152152

153-
Inserts SQL record into database. This record will be erased after the test.
153+
Inserts an SQL record into a database. This record will be erased after the test.
154154

155155
{% highlight php %}
156156

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

169169
#### seeInDatabase
170170

171-
Checks if a row with given column values exists.
171+
Asserts that a row with the given column values exists.
172172
Provide table name and column values.
173173

174174
Example:
@@ -195,7 +195,7 @@ Fails if no such user found.
195195

196196
#### seeNumRecords
197197

198-
Asserts that found number of records in database
198+
Asserts that the given number of records were found in the database.
199199

200200
{% highlight php %}
201201

docs/modules/Dbh.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ This module despite of it's stability may act unstable because of transactions i
5959

6060
Effect is opposite to ->seeInDatabase
6161

62-
Checks if there is no record with such column values in database.
62+
Asserts that there is no record with the given column values in a database.
6363
Provide table name and column values.
6464

6565
Example:
@@ -109,7 +109,7 @@ $mail = $I->grabFromDatabase('users', 'email', array('name' => 'Davert'));
109109

110110
#### seeInDatabase
111111

112-
Checks if a row with given column values exists.
112+
Asserts that a row with the given column values exists.
113113
Provide table name and column values.
114114

115115
Example:

0 commit comments

Comments
 (0)