You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: changelog.markdown
+28Lines changed: 28 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,34 @@ title: Codeception Changelog
7
7
8
8
# Changelog
9
9
10
+
#### 2.1.4
11
+
12
+
* <strong>[PhpBrowser]</strong><strong>[Frameworks]</strong> Added `_getResponseContent` hidden method. By <strong><ahref="https://github.com/Naktibalda">@Naktibalda</a></strong>
13
+
* <strong>[PhpBrowser]</strong><strong>[Frameworks]</strong> Added `moveBack` method. By <strong><ahref="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><ahref="https://github.com/zbateson">@zbateson</a></strong> in <ahref="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 <ahref="https://github.com/Codeception/Codeception/issues/2471">#2471</a> By <strong><ahref="https://github.com/MasonM">@MasonM</a></strong> and <strong><ahref="https://github.com/DavertMik">@DavertMik</a></strong>.
16
+
* <strong>[ZF2]</strong> grabs service from container without reinitializing it. Fixes <ahref="https://github.com/Codeception/Codeception/issues/2519">#2519</a> where Doctrine2 gets different instances of the entity manager everytime grabServiceFromContainer is called. By <strong><ahref="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 <ahref="https://github.com/Codeception/Codeception/issues/2535">#2535</a>. By <strong><ahref="https://github.com/Naktibalda">@Naktibalda</a></strong>
18
+
* <strong>[REST]</strong> `seeResponseIsJsonType` can now validate emails with `string:email` definition. By <strong><ahref="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. <ahref="https://github.com/Codeception/Codeception/issues/2522">#2522</a> <ahref="https://github.com/Codeception/Codeception/issues/2500">#2500</a> By <strong><ahref="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 <ahref="https://github.com/Codeception/Codeception/issues/2507">#2507</a>. By <strong><ahref="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><ahref="https://github.com/arduanov">@arduanov</a></strong> <ahref="https://github.com/Codeception/Codeception/issues/2503">#2503</a>
22
+
* <strong>[Laravel5]</strong> Removed `expectEvents` and added `seeEventTriggered` and `dontSeeEventTriggered`. By <strong><ahref="https://github.com/janhenkgerritsen">@janhenkgerritsen</a></strong>
23
+
* <strong>[Laravel5]</strong> Fixed fatal error in `seeCurrentRouteIs` and `seeCurrentActionIs` methods. See <ahref="https://github.com/Codeception/Codeception/issues/2517">#2517</a>. By <strong><ahref="https://github.com/janhenkgerritsen">@janhenkgerritsen</a></strong>
24
+
* <strong>[Laravel5]</strong> Improved the error messages for several methods. See <ahref="https://github.com/Codeception/Codeception/issues/2476">#2476</a>. By <strong><ahref="https://github.com/janhenkgerritsen">@janhenkgerritsen</a></strong>
25
+
* <strong>[Laravel5]</strong> Improved form error methods. See <ahref="https://github.com/Codeception/Codeception/issues/2432">#2432</a>. By <strong><ahref="https://github.com/janhenkgerritsen">@janhenkgerritsen</a></strong>
26
+
* <strong>[Laravel5]</strong> Added wrapper methods for Laravel 5 model factories. See <ahref="https://github.com/Codeception/Codeception/issues/2442">#2442</a>. By <strong><ahref="https://github.com/janhenkgerritsen">@janhenkgerritsen</a></strong>
27
+
* <strong>[Phalcon]</strong> Added `amOnRoute` and `seeCurrentRouteIs` methods by <strong><ahref="https://github.com/sergeyklay">@sergeyklay</a></strong>
28
+
* <strong>[Phalcon]</strong> Added `seeSessionHasValues` by <strong><ahref="https://github.com/sergeyklay">@sergeyklay</a></strong>
29
+
* <strong>[Phalcon]</strong> Added `getApplication()` method by <strong><ahref="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 <ahref="https://github.com/Codeception/Codeception/issues/2462">#2462</a> by <strong><ahref="https://github.com/mhightower">@mhightower</a></strong>
31
+
* <strong>[Db]</strong> Save the search path when importing Postgres dumps <ahref="https://github.com/Codeception/Codeception/issues/2441">#2441</a> by <strong><ahref="https://github.com/EspadaV8">@EspadaV8</a></strong>
32
+
* <strong>[Yii2]</strong> Fixed problems with transaction rollbacks when using the `cleanup` flag. See <ahref="https://github.com/Codeception/Codeception/issues/2488">#2488</a>. By <strong><ahref="https://github.com/ivokund">@ivokund</a></strong>
33
+
* <strong>[Yii2]</strong> Clean up previously uploaded files between tests by <strong><ahref="https://github.com/tibee">@tibee</a></strong>
34
+
* Actor classes generation improved by <strong><ahref="https://github.com/codemedic">@codemedic</a></strong> <ahref="https://github.com/Codeception/Codeception/issues/2453">#2453</a>
35
+
* Added support for nested helper by <strong><ahref="https://github.com/luka">@luka</a></strong>-zitnik <ahref="https://github.com/Codeception/Codeception/issues/2494">#2494</a>
36
+
* Make `generate:suite` respect bootstrap setting in <ahref="https://github.com/Codeception/Codeception/issues/2512">#2512</a>. By <strong><ahref="https://github.com/dmitrivereshchagin">@dmitrivereshchagin</a></strong>
37
+
10
38
#### 2.1.3
11
39
12
40
* <strong>[REST]</strong> **Added matching data types** by with new methods `seeResponseMatchesJsonType` and `dontSeeResponseMatchesJsonType`. See <ahref="https://github.com/Codeception/Codeception/issues/2391">#2391</a>
Copy file name to clipboardExpand all lines: docs/10-WebServices.md
+23-1Lines changed: 23 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -108,7 +108,7 @@ $I->seeResponseContainsJson([
108
108
109
109
{% endhighlight %}
110
110
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:
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
+
150
172
### Testing XML Responses
151
173
152
174
In case your REST API works with XML format you can use similar methods to test its data and structure.
Copy file name to clipboardExpand all lines: docs/modules/Db.md
+19-19Lines changed: 19 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,15 +12,15 @@ title: Db - Codeception - Documentation
12
12
13
13
Works with SQL database.
14
14
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`.
17
17
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.
19
19
20
20
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.
24
24
25
25
Supported and tested databases are:
26
26
@@ -33,8 +33,8 @@ Supported but not tested.
33
33
* MSSQL
34
34
* Oracle
35
35
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.
38
38
39
39
### Status
40
40
@@ -54,10 +54,10 @@ Check out drivers if you get problems loading dumps and cleaning databases.
54
54
* dsn *required* - PDO DSN
55
55
* user *required* - user to access database
56
56
* 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
61
61
62
62
#### Example
63
63
@@ -76,7 +76,7 @@ Check out drivers if you get problems loading dumps and cleaning databases.
76
76
77
77
* Comments are permitted.
78
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:
79
+
* The delimiter, a semi-colon in this case, must be on the same line as the last statement:
80
80
81
81
{% highlight sql %}
82
82
@@ -91,16 +91,16 @@ DELETE FROM `Order`;
91
91
{% endhighlight %}
92
92
93
93
### 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
96
96
97
97
98
98
99
99
#### dontSeeInDatabase
100
100
101
101
Effect is opposite to ->seeInDatabase
102
102
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.
0 commit comments