From 3ce4d6ab58daa9537ea898e7ca088a9667c3e364 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Tamarelle?= Date: Wed, 18 Sep 2024 22:48:49 +0200 Subject: [PATCH] Revert hidding warnings in examples --- CONTRIBUTING.md | 6 ------ tests/ExamplesTest.php | 13 +------------ 2 files changed, 1 insertion(+), 18 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0fb70ba3b..fe387e26d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -43,12 +43,6 @@ credentials in the connection string (i.e. `MONGODB_URI`) or set the Note that `MONGODB_USERNAME` and `MONGODB_PASSWORD` will override any credentials present in the connection string. -To run tests use the `phpunit` executable installed by Composer: - -```console -$ vendor/bin/phpunit -``` - ### Environment Variables The test suite references the following environment variables: diff --git a/tests/ExamplesTest.php b/tests/ExamplesTest.php index 7053e29f9..7946622f4 100644 --- a/tests/ExamplesTest.php +++ b/tests/ExamplesTest.php @@ -5,15 +5,11 @@ use Generator; use function bin2hex; -use function error_reporting; use function getenv; use function putenv; use function random_bytes; use function sprintf; -use const E_ALL; -use const E_DEPRECATED; - /** @runTestsInSeparateProcesses */ final class ExamplesTest extends FunctionalTestCase { @@ -308,14 +304,7 @@ public function testWithTransaction(): void private function assertExampleOutput(string $file, string $expectedOutput): void { - // Hide deprecation messages - $level = error_reporting(E_ALL ^ E_DEPRECATED); - - try { - require $file; - } finally { - error_reporting($level); - } + require $file; $this->assertStringMatchesFormat($expectedOutput, $this->getActualOutputForAssertion()); }