Skip to content

Commit 1f5e3ca

Browse files
committed
Update changelog and module docs
1 parent 039b3de commit 1f5e3ca

File tree

3 files changed

+35
-11
lines changed

3 files changed

+35
-11
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.20
12+
13+
* Fix compatibility with PHP 7.0 ([#6154](https://github.com/Codeception/Codeception/issues/6154))
14+
1115
#### 4.1.19
1216

1317
* Action file generator supports PHP 8 union types

docs/modules/Redis.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,15 @@ to interact with a Redis server.
4444
* **`host`** (`string`, default `'127.0.0.1'`) - The Redis host
4545
* **`port`** (`int`, default `6379`) - The Redis port
4646
* **`database`** (`int`, no default) - The Redis database. Needs to be specified.
47+
* **`username`** (`string`, no default) - When ACLs are enabled on Redis >= 6.0, both username and password are required for user authentication.
48+
* **`password`** (`string`, no default) - The Redis password/secret.
4749
* **`cleanupBefore`**: (`string`, default `'never'`) - Whether/when to flush the database:
4850
* `suite`: at the beginning of every suite
4951
* `test`: at the beginning of every test
5052
* Any other value: never
5153

54+
Note: The full configuration list can be found on Predis' github.
55+
5256
#### Example (`unit.suite.yml`)
5357

5458
{% highlight yaml %}

docs/modules/Symfony.md

Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,14 @@ Warning. Using PHAR file and composer in the same project can cause unexpected e
3232

3333

3434

35-
This module uses Symfony Crawler and HttpKernel to emulate requests and test response.
35+
This module uses [Symfony's DomCrawler](https://symfony.com/doc/current/components/dom_crawler.html)
36+
and [HttpKernel Component](https://symfony.com/doc/current/components/http_kernel.html) to emulate requests and test response.
37+
38+
* Access Symfony services through the dependency injection container: [`$I->grabService(...)`](#grabService)
39+
* Use Doctrine to test against the database: `$I->seeInRepository(...)` - see [Doctrine Module](https://codeception.com/docs/modules/Doctrine2)
40+
* Assert that emails would have been sent: [`$I->seeEmailIsSent()`](#seeEmailIsSent)
41+
* Tests are wrapped into Doctrine transaction to speed them up.
42+
* Symfony Router can be cached between requests to speed up testing.
3643

3744
### Demo Project
3845

@@ -87,7 +94,7 @@ modules:
8794
- Doctrine2:
8895
depends: Symfony
8996
- WebDriver:
90-
url: http://your-url.com
97+
url: http://example.com
9198
browser: firefox
9299

93100
{% endhighlight %}
@@ -243,7 +250,7 @@ If you have more than one firewall or firewall context, you can specify the desi
243250

244251
<?php
245252
$user = $I->grabEntityFromRepository(User::class, [
246-
'email' => 'john_doe@gmail.com'
253+
'email' => 'john_doe@example.com'
247254
]);
248255
$I->amLoggedInAs($user);
249256

@@ -519,6 +526,9 @@ $I->dontSeeElement('input', ['value' => '123456']);
519526
#### dontSeeEmailIsSent
520527

521528
Checks that no email was sent.
529+
The check is based on `\Symfony\Component\Mailer\EventListener\MessageLoggerListener`, which means:
530+
If your app performs a HTTP redirect, you need to suppress it using [stopFollowingRedirects()](https://codeception.com/docs/modules/Symfony#stopFollowingRedirects) first; otherwise this check will *always* pass.
531+
Starting with version 2.0.0, `codeception/module-symfony` requires your app to use [Symfony Mailer](https://symfony.com/doc/current/mailer.html). If your app still uses [Swift Mailer](https://symfony.com/doc/current/email.html), set your version constraint to `^1.6`.
522532

523533

524534
#### dontSeeEventTriggered
@@ -852,13 +862,17 @@ $uri = $I->grabFromCurrentUrl();
852862
#### grabLastSentEmail
853863

854864
Returns the last sent email.
865+
The function is based on `\Symfony\Component\Mailer\EventListener\MessageLoggerListener`, which means:
866+
If your app performs a HTTP redirect after sending the email, you need to suppress it using [stopFollowingRedirects()](https://codeception.com/docs/modules/Symfony#stopFollowingRedirects) first.
867+
Starting with version 2.0.0, `codeception/module-symfony` requires your app to use [Symfony Mailer](https://symfony.com/doc/current/mailer.html). If your app still uses [Swift Mailer](https://symfony.com/doc/current/email.html), set your version constraint to `^1.6`.
868+
See also: [grabSentEmails()](https://codeception.com/docs/modules/Symfony#grabSentEmails)
855869

856870
{% highlight php %}
857871

858872
<?php
859873
$email = $I->grabLastSentEmail();
860874
$address = $email->getTo()[0];
861-
$I->assertSame('john_doe@user.com', $address->getAddress());
875+
$I->assertSame('john_doe@example.com', $address->getAddress());
862876

863877
{% endhighlight %}
864878

@@ -958,13 +972,15 @@ $I->grabRepository(UserRepositoryInterface::class);
958972
#### grabSentEmails
959973

960974
Returns an array of all sent emails.
975+
The function is based on `\Symfony\Component\Mailer\EventListener\MessageLoggerListener`, which means:
976+
If your app performs a HTTP redirect after sending the email, you need to suppress it using [stopFollowingRedirects()](https://codeception.com/docs/modules/Symfony#stopFollowingRedirects) first.
977+
Starting with version 2.0.0, `codeception/module-symfony` requires your app to use [Symfony Mailer](https://symfony.com/doc/current/mailer.html). If your app still uses [Swift Mailer](https://symfony.com/doc/current/email.html), set your version constraint to `^1.6`.
978+
See also: [grabLastSentEmail()](https://codeception.com/docs/modules/Symfony#grabLastSentEmail)
961979

962980
{% highlight php %}
963981

964982
<?php
965983
$emails = $I->grabSentEmails();
966-
$address = $emails[0]->getTo()[0];
967-
$I->assertSame('john_doe@user.com', $address->getAddress());
968984

969985
{% endhighlight %}
970986

@@ -1355,10 +1371,10 @@ $I->seeElement(['css' => 'form input'], ['name' => 'login']);
13551371

13561372
#### seeEmailIsSent
13571373

1358-
Checks if the desired number of emails was sent.
1359-
Asserts that 1 email was sent by default, specify the `expectedCount` parameter to modify it.
1360-
The email is checked using Symfony message logger, which means:
1361-
* If your app performs a redirect after sending the email, you need to suppress it using [stopFollowingRedirects](https://codeception.com/docs/modules/Symfony#stopFollowingRedirects).
1374+
Checks if the given number of emails was sent (default `$expectedCount`: 1).
1375+
The check is based on `\Symfony\Component\Mailer\EventListener\MessageLoggerListener`, which means:
1376+
If your app performs a HTTP redirect after sending the email, you need to suppress it using [stopFollowingRedirects()](https://codeception.com/docs/modules/Symfony#stopFollowingRedirects) first.
1377+
Starting with version 2.0.0, `codeception/module-symfony` requires your app to use [Symfony Mailer](https://symfony.com/doc/current/mailer.html). If your app still uses [Swift Mailer](https://symfony.com/doc/current/email.html), set your version constraint to `^1.6`.
13621378

13631379
{% highlight php %}
13641380

@@ -2266,7 +2282,7 @@ If you customized the names of the field selectors use $I->submitForm() for full
22662282

22672283
<?php
22682284
$I->submitSymfonyForm('login_form', [
2269-
'[email]' => 'john_doe@gmail.com',
2285+
'[email]' => 'john_doe@example.com',
22702286
'[password]' => 'secretForest'
22712287
]);
22722288

0 commit comments

Comments
 (0)