Skip to content

Commit 56bfc38

Browse files
committed
Update changelog and module docs
1 parent 7ef8be0 commit 56bfc38

File tree

3 files changed

+91
-30
lines changed

3 files changed

+91
-30
lines changed

changelog.markdown

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ title: Codeception Changelog
88
# Changelog
99

1010

11+
#### 4.1.14
12+
13+
* Improved compatibility logic for Symfony EventDispatcher
14+
1115
#### 4.1.13
1216

1317
* Gherkin: Fixed loading methods from namespaced helper classes [#6057](https://github.com/Codeception/Codeception/issues/6057)

docs/modules/Symfony.md

Lines changed: 84 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ This module uses Symfony Crawler and HttpKernel to emulate requests and test res
3636

3737
### Demo Project
3838

39-
<https://github.com/Codeception/symfony-demo>
39+
<https://github.com/Codeception/symfony-module-tests>
4040

4141
### Config
4242

@@ -542,6 +542,21 @@ Checks that no email was sent. This is an alias for seeEmailIsSent(0).
542542
* `[Part]` email
543543

544544

545+
#### dontSeeEventTriggered
546+
547+
Make sure events did not fire during the test.
548+
549+
{% highlight php %}
550+
551+
<?php
552+
$I->dontSeeEventTriggered('App\MyEvent');
553+
$I->dontSeeEventTriggered(new App\Events\MyEvent());
554+
$I->dontSeeEventTriggered(['App\MyEvent', 'App\MyOtherEvent']);
555+
556+
{% endhighlight %}
557+
* `param string|object|string[]` $expected
558+
559+
545560
#### dontSeeFormErrors
546561

547562
Verifies that there are no errors bound to the submitted form.
@@ -1310,6 +1325,57 @@ $I->seeFormErrorMessage('username', 'Username is empty');
13101325
* `param string|null` $message
13111326

13121327

1328+
#### seeFormErrorMessages
1329+
1330+
Verifies that multiple fields on a form have errors.
1331+
1332+
If you only specify the name of the fields, this method will
1333+
verify that the field contains at least one error of any type:
1334+
1335+
{% highlight php %}
1336+
1337+
<?php
1338+
$I->seeFormErrorMessages(['telephone', 'address']);
1339+
1340+
{% endhighlight %}
1341+
1342+
If you want to specify the error messages, you can do so
1343+
by sending an associative array instead, with the key being
1344+
the name of the field and the error message the value.
1345+
1346+
This method will validate that the expected error message
1347+
is contained in the actual error message, that is,
1348+
you can specify either the entire error message or just a part of it:
1349+
1350+
{% highlight php %}
1351+
1352+
<?php
1353+
$I->seeFormErrorMessages([
1354+
'address' => 'The address is too long'
1355+
'telephone' => 'too short', // the full error message is 'The telephone is too short'
1356+
]);
1357+
1358+
{% endhighlight %}
1359+
1360+
If you don't want to specify the error message for some fields,
1361+
you can pass `null` as value instead of the message string,
1362+
or you can directly omit the value of that field. If that is the case,
1363+
it will be validated that that field has at least one error of any type:
1364+
1365+
{% highlight php %}
1366+
1367+
<?php
1368+
$I->seeFormErrorMessages([
1369+
'telephone' => 'too short',
1370+
'address' => null,
1371+
'postal code',
1372+
]);
1373+
1374+
{% endhighlight %}
1375+
1376+
* `param string[]` $expectedErrors
1377+
1378+
13131379
#### seeFormHasErrors
13141380

13151381
Verifies that there are one or more errors bound to the submitted form.
@@ -1455,12 +1521,12 @@ Assert that a session attribute exists.
14551521
{% highlight php %}
14561522

14571523
<?php
1458-
$I->seeInSession('attrib');
1459-
$I->seeInSession('attrib', 'value');
1524+
$I->seeInSession('attribute');
1525+
$I->seeInSession('attribute', 'value');
14601526

14611527
{% endhighlight %}
14621528

1463-
* `param string` $attrib
1529+
* `param string` $attribute
14641530
* `param mixed|null` $value
14651531

14661532

@@ -1684,6 +1750,20 @@ $I->seeUserHasRole('ROLE_ADMIN');
16841750
* `param string` $role
16851751

16861752

1753+
#### seeUserHasRoles
1754+
1755+
Verifies that the current user has multiple roles
1756+
1757+
{% highlight php %}
1758+
1759+
<?php
1760+
$I->seeUserHasRoles(['ROLE_USER', 'ROLE_ADMIN']);
1761+
1762+
{% endhighlight %}
1763+
1764+
* `param string[]` $roles
1765+
1766+
16871767
#### seeUserPasswordDoesNotNeedRehash
16881768

16891769
Checks that the user's password would not benefit from rehashing.

docs/modules/Yii2.md

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ modules:
9999

100100
{% endhighlight %}
101101

102-
#### Parts
102+
### Parts
103103

104104
By default all available methods are loaded, but you can also use the `part`
105105
option to select only the needed actions and to avoid conflicts. The
@@ -110,31 +110,8 @@ avilable parts are:
110110
* `fixtures` - use fixtures inside tests with `haveFixtures/grabFixture/grabFixtures` actions.
111111
* `email` - include email actions `seeEmailsIsSent/grabLastSentEmail/...`
112112

113-
#### Example (`functional.suite.yml`)
114-
115-
{% highlight yaml %}
116-
117-
actor: FunctionalTester
118-
modules:
119-
enabled:
120-
- Yii2:
121-
configFile: 'config/test.php'
122-
123-
{% endhighlight %}
124-
125-
#### Example (`unit.suite.yml`)
126-
127-
{% highlight yaml %}
128-
129-
actor: UnitTester
130-
modules:
131-
enabled:
132-
- Asserts
133-
- Yii2:
134-
configFile: 'config/test.php'
135-
part: init
136-
137-
{% endhighlight %}
113+
See [WebDriver module](https://codeception.com/docs/modules/WebDriver#Loading-Parts-from-other-Modules)
114+
for general information on how to load parts of a framework module.
138115

139116
#### Example (`acceptance.suite.yml`)
140117

0 commit comments

Comments
 (0)