Skip to content

Commit 57949f1

Browse files
committed
Suppress deprecations in tests expecting no output
1 parent 3e82bd1 commit 57949f1

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tests/GridFS/BucketFunctionalTest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -860,6 +860,9 @@ public function testDanglingOpenWritableStream(): void
860860
$code = <<<'PHP'
861861
require '%s';
862862
require '%s';
863+
// Don't report deprecations - if the issue exists this code will
864+
// result in a fatal error
865+
error_reporting(E_ALL & ~E_DEPRECATED & ~E_USER_DEPRECATED);
863866
$client = MongoDB\Tests\FunctionalTestCase::createTestClient();
864867
$database = $client->selectDatabase(getenv('MONGODB_DATABASE') ?: 'phplib_test');
865868
$gridfs = $database->selectGridFSBucket();
@@ -903,6 +906,9 @@ public function testDanglingOpenWritableStreamWithGlobalStreamWrapperAlias(): vo
903906
$code = <<<'PHP'
904907
require '%s';
905908
require '%s';
909+
// Don't report deprecations - if the issue exists this code will
910+
// result in a fatal error
911+
error_reporting(E_ALL & ~E_DEPRECATED & ~E_USER_DEPRECATED);
906912
$client = MongoDB\Tests\FunctionalTestCase::createTestClient();
907913
$database = $client->selectDatabase(getenv('MONGODB_DATABASE') ?: 'phplib_test');
908914
$database->selectGridFSBucket()->registerGlobalStreamWrapperAlias('alias');

0 commit comments

Comments
 (0)