Skip to content

Add missing error_level parameter #441

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions docs/03-AcceptanceTests.md
Original file line number Diff line number Diff line change
Expand Up @@ -887,6 +887,22 @@ WebDriver module provides advanced methods for the browser session, however, the

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.

## Error Reporting

By default Codeception uses the `E_ALL & ~E_STRICT & ~E_DEPRECATED` error reporting level.
In acceptance tests you might want to change this level depending on your framework's error policy.
The error reporting level can be set in the suite configuration file:

{% highlight yaml %}

actor: AcceptanceTester
...
error_level: E_ALL & ~E_STRICT & ~E_DEPRECATED

{% endhighlight %}

`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.

## Conclusion

Writing acceptance tests with Codeception and PhpBrowser is a good start.
Expand Down
9 changes: 3 additions & 6 deletions docs/04-FunctionalTests.md
Original file line number Diff line number Diff line change
Expand Up @@ -259,15 +259,12 @@ The error reporting level can be set in the suite configuration file:
{% highlight yaml %}

actor: FunctionalTester
modules:
enabled:
- Yii2
- \Helper\Functional
error_level: "E_ALL & ~E_STRICT & ~E_DEPRECATED"
...
error_level: E_ALL & ~E_STRICT & ~E_DEPRECATED

{% endhighlight %}

`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).
`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.

## Conclusion

Expand Down
16 changes: 16 additions & 0 deletions docs/05-UnitTests.md
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,22 @@ public function testSingleton()
* [AspectMock in Action](http://codeception.com/07-31-2013/nothing-is-untestable-aspect-mock.html)
* [How it Works](http://codeception.com/09-13-2013/understanding-aspectmock.html)

## Error Reporting

By default Codeception uses the `E_ALL & ~E_STRICT & ~E_DEPRECATED` error reporting level.
In unit tests you might want to change this level depending on your framework's error policy.
The error reporting level can be set in the suite configuration file:

{% highlight yaml %}

actor: UnitTester
...
error_level: E_ALL & ~E_STRICT & ~E_DEPRECATED

{% endhighlight %}

`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.

## Conclusion

PHPUnit tests are first-class citizens in test suites. Whenever you need to write and execute unit tests,
Expand Down
8 changes: 7 additions & 1 deletion docs/reference/Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,12 @@ settings:
# Section logging > junit
log_incomplete_skipped: false

# Set the error_reporting level
# You can specify either a predefined constant or an integer value
# See https://www.php.net/manual/en/function.error-reporting.php
# See https://www.php.net/manual/en/errorfunc.constants.php
error_level: E_ALL & ~E_STRICT & ~E_DEPRECATED

{% endhighlight %}

* `modules`: allows to create shared module configuration for all included suites.
Expand Down Expand Up @@ -151,7 +157,7 @@ modules:
* `formats`: [formats](http://codeception.com/docs/07-AdvancedUsage#Formats) with the list of extra test format classes.
* `coverage`: per suite [CodeCoverage](http://codeception.com/docs/11-Codecoverage#Configuration) settings.
* `gherkin`: per suite [BDD Gherkin](http://codeception.com/docs/07-BDD#Configuration) settings.
* `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.
* `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.
* `bootstrap`: bootstrap script that will be executed before current suites. A script should be put into suite directory.

## Config Templates (dist)
Expand Down