When using expectUserDeprecationMessage, we noticed that the expectation is verified correctly but that the test will still fail afterwards because of our strict configuration in regards to deprecations.
We want this strict setup because we want to catch every deprecation that is produced.
But when we are testing/asserting them, we want to silence them obviously.
Current behavior
1 test triggered 1 deprecation:
1) SomethingThatTriggersDeprecation.php:23
Some Deprecation
Triggered by:
* SomeTest::it_should
/Path/To/SomeTest.php:82
OK, but there were issues!
Tests: 1, Assertions: 8, Deprecations: 1.
Process finished with exit code 1
#[Test]
public function it_should_resolve_to_list() : void
{
$this->expectUserDeprecationMessage('Some Deprecation'); // this works, it verifies the expected deprecation
$callSomethingThatTriggerIt();
}
Expected behavior
No deprecation at the end of the test + no failing test.
Summary
When using
expectUserDeprecationMessage
, we noticed that the expectation is verified correctly but that the test will still fail afterwards because of our strict configuration in regards to deprecations.We want this strict setup because we want to catch every deprecation that is produced.
But when we are testing/asserting them, we want to silence them obviously.
Current behavior
How to reproduce
Expected behavior
No deprecation at the end of the test + no failing test.