minor #38294 [OptionsResolver] Assert that the error type is valid in deprecations test (fancyweb)

This PR was merged into the 4.4 branch.

Discussion
----------

[OptionsResolver] Assert that the error type is valid in deprecations test

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | no
| License       | MIT
| Doc PR        | no

A change in the code could cause a warning for example and still produce the expected number of errors and the expected last error. Checking the type of the error is a little bit better. The best would be to check all the expected deprecations one by one, maybe later? 😄

Commits
-------

926d18f2f9 [OptionsResolver] Assert that the error type is valid in deprecations test
This commit is contained in:
Fabien Potencier 2020-09-25 08:00:01 +02:00
commit f71d8cfabb

View File

@ -518,7 +518,9 @@ class OptionsResolverTest extends TestCase
{
$count = 0;
error_clear_last();
set_error_handler(function () use (&$count) {
set_error_handler(function (int $type) use (&$count) {
$this->assertSame(\E_USER_DEPRECATED, $type);
++$count;
return false;