Skip to content

Commit c1b4fb7

Browse files
committed
Add missing error_level parameter
1 parent eda4365 commit c1b4fb7

File tree

4 files changed

+42
-7
lines changed

4 files changed

+42
-7
lines changed

docs/03-AcceptanceTests.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -887,6 +887,22 @@ WebDriver module provides advanced methods for the browser session, however, the
887887

888888
Those methods can be used to create custom commands like `$I->startBrowser()` or used in [before/after](http://codeception.com/docs/06-ModulesAndHelpers#Hooks) hooks.
889889

890+
## Error Reporting
891+
892+
By default Codeception uses the `E_ALL & ~E_STRICT & ~E_DEPRECATED` error reporting level.
893+
In acceptance tests you might want to change this level depending on your framework's error policy.
894+
The error reporting level can be set in the suite configuration file:
895+
896+
{% highlight yaml %}
897+
898+
actor: AcceptanceTester
899+
...
900+
error_level: E_ALL & ~E_STRICT & ~E_DEPRECATED
901+
902+
{% endhighlight %}
903+
904+
`error_level` can also be set globally in `codeception.yml` file. In order to do that, you need to specify `error_level` as a part of `settings`. For more information, see [Global Configuration](https://codeception.com/docs/reference/Configuration). Note that suite specific `error_level` value will override global value.
905+
890906
## Conclusion
891907

892908
Writing acceptance tests with Codeception and PhpBrowser is a good start.

docs/04-FunctionalTests.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -259,15 +259,12 @@ The error reporting level can be set in the suite configuration file:
259259
{% highlight yaml %}
260260

261261
actor: FunctionalTester
262-
modules:
263-
enabled:
264-
- Yii2
265-
- \Helper\Functional
266-
error_level: "E_ALL & ~E_STRICT & ~E_DEPRECATED"
262+
...
263+
error_level: E_ALL & ~E_STRICT & ~E_DEPRECATED
267264

268265
{% endhighlight %}
269266

270-
`error_level` can also be set globally in `codeception.yml` file. In order to do that, you need to specify `error_level` as a part of `settings`. For more information, see [Global Configuration](https://codeception.com/docs/reference/Configuration).
267+
`error_level` can also be set globally in `codeception.yml` file. In order to do that, you need to specify `error_level` as a part of `settings`. For more information, see [Global Configuration](https://codeception.com/docs/reference/Configuration). Note that suite specific `error_level` value will override global value.
271268

272269
## Conclusion
273270

docs/05-UnitTests.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -514,6 +514,22 @@ public function testSingleton()
514514
* [AspectMock in Action](http://codeception.com/07-31-2013/nothing-is-untestable-aspect-mock.html)
515515
* [How it Works](http://codeception.com/09-13-2013/understanding-aspectmock.html)
516516

517+
## Error Reporting
518+
519+
By default Codeception uses the `E_ALL & ~E_STRICT & ~E_DEPRECATED` error reporting level.
520+
In unit tests you might want to change this level depending on your framework's error policy.
521+
The error reporting level can be set in the suite configuration file:
522+
523+
{% highlight yaml %}
524+
525+
actor: UnitTester
526+
...
527+
error_level: E_ALL & ~E_STRICT & ~E_DEPRECATED
528+
529+
{% endhighlight %}
530+
531+
`error_level` can also be set globally in `codeception.yml` file. In order to do that, you need to specify `error_level` as a part of `settings`. For more information, see [Global Configuration](https://codeception.com/docs/reference/Configuration). Note that suite specific `error_level` value will override global value.
532+
517533
## Conclusion
518534

519535
PHPUnit tests are first-class citizens in test suites. Whenever you need to write and execute unit tests,

docs/reference/Configuration.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,12 @@ settings:
8484
# Section logging > junit
8585
log_incomplete_skipped: false
8686

87+
# Set the error_reporting level
88+
# You can specify either a predefined constant or an integer value
89+
# See https://www.php.net/manual/en/function.error-reporting.php
90+
# See https://www.php.net/manual/en/errorfunc.constants.php
91+
error_level: E_ALL & ~E_STRICT & ~E_DEPRECATED
92+
8793
{% endhighlight %}
8894

8995
* `modules`: allows to create shared module configuration for all included suites.
@@ -151,7 +157,7 @@ modules:
151157
* `formats`: [formats](http://codeception.com/docs/07-AdvancedUsage#Formats) with the list of extra test format classes.
152158
* `coverage`: per suite [CodeCoverage](http://codeception.com/docs/11-Codecoverage#Configuration) settings.
153159
* `gherkin`: per suite [BDD Gherkin](http://codeception.com/docs/07-BDD#Configuration) settings.
154-
* `error_level`: [error level](http://codeception.com/docs/04-FunctionalTests#Error-Reporting) for runner in current suite. Should be specified for unit, integration, functional tests. Passes value to `error_reporting` function.
160+
* `error_level`: [error level](http://codeception.com/docs/04-FunctionalTests#Error-Reporting) for runner in current suite. Can be specified for unit, integration, functional tests. Passes value to `error_reporting` function. Suite specific value will override the global value.
155161
* `bootstrap`: bootstrap script that will be executed before current suites. A script should be put into suite directory.
156162

157163
## Config Templates (dist)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy