Skip to content

Commit 1461a54

Browse files
github-actions[bot]github-actions[bot]
authored andcommitted
updated
1 parent d45623e commit 1461a54

File tree

9 files changed

+63
-65
lines changed

9 files changed

+63
-65
lines changed

docs/modules/Doctrine2.md renamed to docs/modules/Doctrine.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
---
22
layout: doc
3-
title: Doctrine2 - Codeception - Documentation
3+
title: Doctrine - Codeception - Documentation
44
---
55

66

77

8-
<div class="btn-group" role="group" style="float: right" aria-label="..."><a class="btn btn-default" href="https://github.com/Codeception/module-Doctrine2/releases">Releases</a><a class="btn btn-default" href="https://github.com/Codeception/module-doctrine2/tree/master/src/Codeception/Module/Doctrine2.php"><strong>source</strong></a></div>
8+
<div class="btn-group" role="group" style="float: right" aria-label="..."><a class="btn btn-default" href="https://github.com/Codeception/module-Doctrine/releases">Releases</a><a class="btn btn-default" href="https://github.com/Codeception/module-doctrine/tree/master/src/Codeception/Module/Doctrine.php"><strong>source</strong></a></div>
99

10-
# Doctrine2
10+
# Doctrine
1111
### Installation
1212

1313
{% highlight yaml %}
14-
composer require --dev codeception/module-doctrine2
14+
composer require --dev codeception/module-doctrine
1515

1616
{% endhighlight %}
1717

@@ -29,7 +29,7 @@ Set up your `functional.suite.yml` like this:
2929
modules:
3030
enabled:
3131
- Symfony # 'ZF2' or 'Symfony'
32-
- Doctrine2:
32+
- Doctrine:
3333
depends: Symfony # Tells Doctrine to fetch the Entity Manager through Symfony
3434
cleanup: true # All doctrine queries will be wrapped in a transaction, which will be rolled back at the end of each test
3535

@@ -41,7 +41,7 @@ If you don't provide a `depends` key, you need to specify a callback function to
4141

4242
modules:
4343
enabled:
44-
- Doctrine2:
44+
- Doctrine:
4545
connection_callback: ['MyDb', 'createEntityManager'] # Call the static method `MyDb::createEntityManager()` to get the Entity Manager
4646

4747
{% endhighlight %}
@@ -50,15 +50,15 @@ By default, the module will wrap everything into a transaction for each test and
5050
(this is controlled by the `cleanup` setting).
5151
By doing this, tests will run much faster and will be isolated from each other.
5252

53-
To use the Doctrine2 Module in acceptance tests, set up your `acceptance.suite.yml` like this:
53+
To use the Doctrine Module in acceptance tests, set up your `acceptance.suite.yml` like this:
5454

5555
{% highlight yaml %}
5656

5757
modules:
5858
enabled:
5959
- Symfony:
6060
part: SERVICES
61-
- Doctrine2:
61+
- Doctrine:
6262
depends: Symfony
6363

6464
{% endhighlight %}
@@ -72,7 +72,7 @@ are using to purge the database tables:
7272

7373
modules:
7474
enabled:
75-
- Doctrine2:
75+
- Doctrine:
7676
purge_mode: 1 # 1: DELETE (=default), 2: TRUNCATE
7777

7878
{% endhighlight %}
@@ -427,4 +427,4 @@ $I->seeInRepository(Client::class, ['User' => ['Company' => ['name' => 'Codegyre
427427

428428
Fails if record for given criteria can\'t be found,
429429

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

docs/modules/Laminas.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -736,7 +736,7 @@ $aLinks = $I->grabMultiple('a', 'href');
736736

737737
#### grabPageSource
738738

739-
* `throws ModuleException` if no page was opened.
739+
* `throws \Codeception\Exception\ModuleException` if no page was opened.
740740
* `return string` Current page source code.
741741

742742
Grabs current page source code.

docs/modules/Laravel.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1157,7 +1157,7 @@ $I->grabNumRecords('App\Models\User', ['name' => 'Davert']);
11571157

11581158
#### grabPageSource
11591159

1160-
* `throws ModuleException` if no page was opened.
1160+
* `throws \Codeception\Exception\ModuleException` if no page was opened.
11611161
* `return string` Current page source code.
11621162

11631163
Grabs current page source code.

docs/modules/Lumen.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -772,7 +772,7 @@ $aLinks = $I->grabMultiple('a', 'href');
772772

773773
#### grabPageSource
774774

775-
* `throws ModuleException` if no page was opened.
775+
* `throws \Codeception\Exception\ModuleException` if no page was opened.
776776
* `return string` Current page source code.
777777

778778
Grabs current page source code.

docs/modules/Mezzio.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -682,7 +682,7 @@ $aLinks = $I->grabMultiple('a', 'href');
682682

683683
#### grabPageSource
684684

685-
* `throws ModuleException` if no page was opened.
685+
* `throws \Codeception\Exception\ModuleException` if no page was opened.
686686
* `return string` Current page source code.
687687

688688
Grabs current page source code.

docs/modules/PhpBrowser.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -786,7 +786,7 @@ $aLinks = $I->grabMultiple('a', 'href');
786786

787787
#### grabPageSource
788788

789-
* `throws ModuleException` if no page was opened.
789+
* `throws \Codeception\Exception\ModuleException` if no page was opened.
790790
* `return string` Current page source code.
791791

792792
Grabs current page source code.

docs/modules/Symfony.md

Lines changed: 22 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ This module uses [Symfony's DomCrawler](https://symfony.com/doc/current/componen
2323
and [HttpKernel Component](https://symfony.com/doc/current/components/http_kernel.html) to emulate requests and test response.
2424

2525
* Access Symfony services through the dependency injection container: [`$I->grabService(...)`](#grabService)
26-
* Use Doctrine to test against the database: `$I->seeInRepository(...)` - see [Doctrine Module](https://codeception.com/docs/modules/Doctrine2)
26+
* Use Doctrine to test against the database: `$I->seeInRepository(...)` - see [Doctrine Module](https://codeception.com/docs/modules/Doctrine)
2727
* Assert that emails would have been sent: [`$I->seeEmailIsSent()`](#seeEmailIsSent)
2828
* Tests are wrapped into Doctrine transaction to speed them up.
2929
* Symfony Router can be cached between requests to speed up testing.
@@ -34,19 +34,19 @@ and [HttpKernel Component](https://symfony.com/doc/current/components/http_kerne
3434

3535
### Config
3636

37-
#### Symfony 5.x or 4.4
37+
#### Symfony 5.4 or higher
3838

39-
* app_path: 'src' - Specify custom path to your app dir, where the kernel interface is located.
40-
* environment: 'local' - Environment used for load kernel
41-
* kernel_class: 'App\Kernel' - Kernel class name
42-
* em_service: 'doctrine.orm.entity_manager' - Use the stated EntityManager to pair with Doctrine Module.
43-
* debug: true - Turn on/off debug mode
44-
* cache_router: 'false' - Enable router caching between tests in order to [increase performance](http://lakion.com/blog/how-did-we-speed-up-sylius-behat-suite-with-blackfire)
45-
* rebootable_client: 'true' - Reboot client's kernel before each request
46-
* guard: 'false' - Enable custom authentication system with guard (only for 4.x and 5.x versions of the symfony)
47-
* authenticator: 'false' - Reboot client's kernel before each request (only for 6.x versions of the symfony)
39+
* `app_path`: 'src' - Specify custom path to your app dir, where the kernel interface is located.
40+
* `environment`: 'local' - Environment used for load kernel
41+
* `kernel_class`: 'App\Kernel' - Kernel class name
42+
* `em_service`: 'doctrine.orm.entity_manager' - Use the stated EntityManager to pair with Doctrine Module.
43+
* `debug`: true - Turn on/off [debug mode](https://codeception.com/docs/Debugging)
44+
* `cache_router`: 'false' - Enable router caching between tests in order to [increase performance](http://lakion.com/blog/how-did-we-speed-up-sylius-behat-suite-with-blackfire)
45+
* `rebootable_client`: 'true' - Reboot client's kernel before each request
46+
* `guard`: 'false' - Enable custom authentication system with guard (only for Symfony 5.4)
47+
* `authenticator`: 'false' - Reboot client's kernel before each request (only for Symfony 6.0 or higher)
4848

49-
##### Example (`functional.suite.yml`) - Symfony 4 Directory Structure
49+
##### Sample `Functional.suite.yml`
5050

5151
modules:
5252
enabled:
@@ -80,15 +80,15 @@ modules:
8080
enabled:
8181
- Symfony:
8282
part: services
83-
- Doctrine2:
83+
- Doctrine:
8484
depends: Symfony
8585
- WebDriver:
8686
url: http://example.com
8787
browser: firefox
8888

8989
{% endhighlight %}
9090

91-
If you're using Symfony with Eloquent ORM (instead of Doctrine), you can load the [`ORM` part of Laravel module](https://codeception.com/docs/modules/Laravel5#Parts)
91+
If you're using Symfony with Eloquent ORM (instead of Doctrine), you can load the [`ORM` part of Laravel module](https://codeception.com/docs/modules/Laravel#Parts)
9292
in addition to Symfony module.
9393

9494

@@ -726,8 +726,7 @@ $I->dontSeeElement('input', ['value' => '123456']);
726726
Checks that no email was sent.
727727

728728
The check is based on `\Symfony\Component\Mailer\EventListener\MessageLoggerListener`, which means:
729-
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.
730-
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`.
729+
If your app performs an HTTP redirect, you need to suppress it using [stopFollowingRedirects()](https://codeception.com/docs/modules/Symfony#stopFollowingRedirects) first; otherwise this check will *always* pass.
731730

732731

733732
#### dontSeeEvent
@@ -1126,8 +1125,7 @@ $uri = $I->grabFromCurrentUrl();
11261125
Returns the last sent email.
11271126

11281127
The function is based on `\Symfony\Component\Mailer\EventListener\MessageLoggerListener`, which means:
1129-
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.
1130-
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`.
1128+
If your app performs an HTTP redirect after sending the email, you need to suppress it using [stopFollowingRedirects()](https://codeception.com/docs/modules/Symfony#stopFollowingRedirects) first.
11311129
See also: [grabSentEmails()](https://codeception.com/docs/modules/Symfony#grabSentEmails)
11321130

11331131
{% highlight php %}
@@ -1188,7 +1186,7 @@ $I->grabNumRecords('User::class', ['name' => 'davert']);
11881186

11891187
#### grabPageSource
11901188

1191-
* `throws ModuleException` if no page was opened.
1189+
* `throws \Codeception\Exception\ModuleException` if no page was opened.
11921190
* `return string` Current page source code.
11931191

11941192
Grabs current page source code.
@@ -1197,7 +1195,7 @@ Grabs current page source code.
11971195
#### grabParameter
11981196

11991197
* `param string` $parameterName
1200-
* `return array|bool|float|int|string|null`
1198+
* `return \UnitEnum|array|string|int|float|bool|null`
12011199

12021200
Grabs a Symfony parameter
12031201

@@ -1236,8 +1234,7 @@ $I->grabRepository(UserRepositoryInterface::class);
12361234
Returns an array of all sent emails.
12371235

12381236
The function is based on `\Symfony\Component\Mailer\EventListener\MessageLoggerListener`, which means:
1239-
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.
1240-
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`.
1237+
If your app performs an HTTP redirect after sending the email, you need to suppress it using [stopFollowingRedirects()](https://codeception.com/docs/modules/Symfony#stopFollowingRedirects) first.
12411238
See also: [grabLastSentEmail()](https://codeception.com/docs/modules/Symfony#grabLastSentEmail)
12421239

12431240
{% highlight php %}
@@ -1690,8 +1687,7 @@ $I->seeElement(['css' => 'form input'], ['name' => 'login']);
16901687
Checks if the given number of emails was sent (default `$expectedCount`: 1).
16911688

16921689
The check is based on `\Symfony\Component\Mailer\EventListener\MessageLoggerListener`, which means:
1693-
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.
1694-
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`.
1690+
If your app performs an HTTP redirect after sending the email, you need to suppress it using [stopFollowingRedirects()](https://codeception.com/docs/modules/Symfony#stopFollowingRedirects) first.
16951691

16961692
{% highlight php %}
16971693

@@ -2117,7 +2113,7 @@ $I->seeOrphanEvent(['App\MyEvent', 'App\MyOtherEvent']);
21172113

21182114
Verifies that a page is available.
21192115

2120-
By default it checks the current page, specify the `$url` parameter to change it.
2116+
By default, it checks the current page, specify the `$url` parameter to change it.
21212117

21222118
{% highlight php %}
21232119

@@ -2192,7 +2188,7 @@ $I->seeRenderedTemplate('layout.html.twig');
21922188

21932189
Asserts that the time a request lasted is less than expected.
21942190

2195-
If the page performed a HTTP redirect, only the time of the last request will be taken into account.
2191+
If the page performed an HTTP redirect, only the time of the last request will be taken into account.
21962192
You can modify this behavior using [stopFollowingRedirects()](https://codeception.com/docs/modules/Symfony#stopFollowingRedirects) first.
21972193

21982194
Also, note that using code coverage can significantly increase the time it takes to resolve a request,

docs/modules/WebDriver.md

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ modules:
6060
url: 'http://localhost/'
6161
browser: chrome
6262
capabilities:
63-
chromeOptions:
64-
args: ["--headless", "--disable-gpu"]
63+
goog:chromeOptions:
64+
args: ["--headless"]
6565

6666
{% endhighlight %}
6767

@@ -98,8 +98,8 @@ modules:
9898
window_size: 2000x1000
9999
port: 9515
100100
capabilities:
101-
chromeOptions:
102-
args: ["--headless", "--disable-gpu"] # Run Chrome in headless mode
101+
goog:chromeOptions:
102+
args: ["--headless"] # Run Chrome in headless mode
103103
prefs:
104104
download.default_directory: "..."
105105

@@ -143,7 +143,7 @@ you should use a tunnel application provided by a service.
143143

144144
1. Create an account at [SauceLabs.com](https://saucelabs.com/) to get your username and access key
145145
2. In the module configuration use the format `username`:`access_key`@ondemand.saucelabs.com' for `host`
146-
3. Configure `platform` under `capabilities` to define the [Operating System](https://docs.saucelabs.com/basics/platform-configurator/)
146+
3. Configure `platformName` under `capabilities` to define the [Operating System](https://docs.saucelabs.com/basics/platform-configurator/)
147147
4. run a tunnel app if your site can't be accessed from Internet
148148

149149
{% highlight yaml %}
@@ -156,7 +156,7 @@ you should use a tunnel application provided by a service.
156156
port: 80
157157
browser: chrome
158158
capabilities:
159-
platform: 'Windows 10'
159+
platformName: 'Windows 10'
160160

161161
{% endhighlight %}
162162

@@ -177,9 +177,10 @@ you should use a tunnel application provided by a service.
177177
port: 80
178178
browser: chrome
179179
capabilities:
180-
os: Windows
181-
os_version: 10
182-
browserstack.local: true # for local testing
180+
bstack:options:
181+
os: Windows
182+
osVersion: 10
183+
local: true # for local testing
183184

184185
{% endhighlight %}
185186

@@ -212,7 +213,7 @@ you should use a tunnel application provided by a service.
212213

213214
1. Create an account at [TestingBot](https://testingbot.com/) to get your key and secret
214215
2. In the module configuration use the format `key`:`secret`@hub.testingbot.com' for `host`
215-
3. Configure `platform` under `capabilities` to define the [Operating System](https://testingbot.com/support/getting-started/browsers.html)
216+
3. Configure `platformName` under `capabilities` to define the [Operating System](https://testingbot.com/support/getting-started/browsers.html)
216217
4. Run [TestingBot Tunnel](https://testingbot.com/support/other/tunnel) if your site can't be accessed from Internet
217218

218219
{% highlight yaml %}
@@ -225,7 +226,7 @@ you should use a tunnel application provided by a service.
225226
port: 80
226227
browser: chrome
227228
capabilities:
228-
platform: Windows 10
229+
platformName: Windows 10
229230

230231
{% endhighlight %}
231232

@@ -264,8 +265,9 @@ Example (`acceptance.suite.yml`)
264265
browser: firefox
265266
window_size: 1024x768
266267
capabilities:
267-
unexpectedAlertBehaviour: 'accept'
268-
firefox_profile: '~/firefox-profiles/codeception-profile.zip.b64'
268+
unhandledPromptBehaviour: 'accept'
269+
moz:firefoxOptions:
270+
profile: '~/firefox-profiles/codeception-profile.zip.b64'
269271

270272
{% endhighlight %}
271273

@@ -1596,12 +1598,12 @@ For special keys, use the constants from [`Facebook\WebDriver\WebDriverKeys`](ht
15961598
{% highlight php %}
15971599

15981600
<?php
1599-
// <input id="page" value="old" />
1600-
$I->pressKey('#page','a'); // => olda
1601-
$I->pressKey('#page',array('ctrl','a'),'new'); //=> new
1602-
$I->pressKey('#page',array('shift','111'),'1','x'); //=> old!!!1x
1601+
// <input id="page" value="old">
1602+
$I->pressKey('#page', 'a'); // => olda
1603+
$I->pressKey('#page', ['ctrl', 'a'],'new'); //=> new
1604+
$I->pressKey('#page', ['shift', '111'],'1','x'); //=> old!!!1x
16031605
$I->pressKey('descendant-or-self::*[@id='page']','u'); //=> oldu
1604-
$I->pressKey('#name', array('ctrl', 'a'), \Facebook\WebDriver\WebDriverKeys::DELETE); //=>''
1606+
$I->pressKey('#name', ['ctrl', 'a'], \Facebook\WebDriver\WebDriverKeys::DELETE); //=>''
16051607

16061608
{% endhighlight %}
16071609

@@ -2183,17 +2185,17 @@ For example, given this sample "Sign Up" form:
21832185

21842186
<form action="/sign_up">
21852187
Login:
2186-
<input type="text" name="user[login]" /><br/>
2188+
<input type="text" name="user[login]"><br>
21872189
Password:
2188-
<input type="password" name="user[password]" /><br/>
2190+
<input type="password" name="user[password]"><br>
21892191
Do you agree to our terms?
2190-
<input type="checkbox" name="user[agree]" /><br/>
2192+
<input type="checkbox" name="user[agree]"><br>
21912193
Select pricing plan:
21922194
<select name="plan">
21932195
<option value="1">Free</option>
21942196
<option value="2" selected="selected">Paid</option>
21952197
</select>
2196-
<input type="submit" name="submitButton" value="Submit" />
2198+
<input type="submit" name="submitButton" value="Submit">
21972199
</form>
21982200

21992201
{% endhighlight %}
@@ -2307,7 +2309,7 @@ For example, given the following HTML:
23072309

23082310
{% highlight html %}
23092311

2310-
<input type="submit" name="submitButton" value="Submit" />
2312+
<input type="submit" name="submitButton" value="Submit">
23112313

23122314
{% endhighlight %}
23132315

docs/modules/Yii2.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -962,7 +962,7 @@ $aLinks = $I->grabMultiple('a', 'href');
962962

963963
#### grabPageSource
964964

965-
* `throws ModuleException` if no page was opened.
965+
* `throws \Codeception\Exception\ModuleException` if no page was opened.
966966
* `return string` Current page source code.
967967

968968
Grabs current page source code.

0 commit comments

Comments
 (0)