diff --git a/.evergreen/config/generated/test/require-api-version-5.0.yml b/.evergreen/config/generated/test/require-api-version-5.0.yml index 0a2a20fd2..fc43a4bd7 100644 --- a/.evergreen/config/generated/test/require-api-version-5.0.yml +++ b/.evergreen/config/generated/test/require-api-version-5.0.yml @@ -1,6 +1,6 @@ # This file is generated automatically - please edit the "templates/test/require-api-version.yml" template file instead. tasks: - - name: "test-requireApiVersion-5.0" + - name: "test-mongodb-5.0-requireApiVersion" tags: ["standalone", "local", "5.0", "versioned_api"] commands: - func: "bootstrap mongo-orchestration" @@ -15,7 +15,7 @@ tasks: vars: API_VERSION: "1" - - name: "test-acceptApiVersion2-5.0" + - name: "test-mongodb-5.0-acceptApiVersion2" tags: ["standalone", "local", "5.0", "versioned_api"] commands: - func: "bootstrap mongo-orchestration" diff --git a/.evergreen/config/generated/test/require-api-version-6.0.yml b/.evergreen/config/generated/test/require-api-version-6.0.yml index 8af0b8c1a..a67154074 100644 --- a/.evergreen/config/generated/test/require-api-version-6.0.yml +++ b/.evergreen/config/generated/test/require-api-version-6.0.yml @@ -1,6 +1,6 @@ # This file is generated automatically - please edit the "templates/test/require-api-version.yml" template file instead. tasks: - - name: "test-requireApiVersion-6.0" + - name: "test-mongodb-6.0-requireApiVersion" tags: ["standalone", "local", "6.0", "versioned_api"] commands: - func: "bootstrap mongo-orchestration" @@ -15,7 +15,7 @@ tasks: vars: API_VERSION: "1" - - name: "test-acceptApiVersion2-6.0" + - name: "test-mongodb-6.0-acceptApiVersion2" tags: ["standalone", "local", "6.0", "versioned_api"] commands: - func: "bootstrap mongo-orchestration" diff --git a/.evergreen/config/generated/test/require-api-version-7.0.yml b/.evergreen/config/generated/test/require-api-version-7.0.yml index 74e747b7a..1e0885084 100644 --- a/.evergreen/config/generated/test/require-api-version-7.0.yml +++ b/.evergreen/config/generated/test/require-api-version-7.0.yml @@ -1,6 +1,6 @@ # This file is generated automatically - please edit the "templates/test/require-api-version.yml" template file instead. tasks: - - name: "test-requireApiVersion-7.0" + - name: "test-mongodb-7.0-requireApiVersion" tags: ["standalone", "local", "7.0", "versioned_api"] commands: - func: "bootstrap mongo-orchestration" @@ -15,7 +15,7 @@ tasks: vars: API_VERSION: "1" - - name: "test-acceptApiVersion2-7.0" + - name: "test-mongodb-7.0-acceptApiVersion2" tags: ["standalone", "local", "7.0", "versioned_api"] commands: - func: "bootstrap mongo-orchestration" diff --git a/.evergreen/config/generated/test/require-api-version-latest.yml b/.evergreen/config/generated/test/require-api-version-latest.yml index d41d54db7..6b7647458 100644 --- a/.evergreen/config/generated/test/require-api-version-latest.yml +++ b/.evergreen/config/generated/test/require-api-version-latest.yml @@ -1,6 +1,6 @@ # This file is generated automatically - please edit the "templates/test/require-api-version.yml" template file instead. tasks: - - name: "test-requireApiVersion-latest" + - name: "test-mongodb-latest-requireApiVersion" tags: ["standalone", "local", "latest", "versioned_api"] commands: - func: "bootstrap mongo-orchestration" @@ -15,7 +15,7 @@ tasks: vars: API_VERSION: "1" - - name: "test-acceptApiVersion2-latest" + - name: "test-mongodb-latest-acceptApiVersion2" tags: ["standalone", "local", "latest", "versioned_api"] commands: - func: "bootstrap mongo-orchestration" diff --git a/.evergreen/config/generated/test/require-api-version-rapid.yml b/.evergreen/config/generated/test/require-api-version-rapid.yml index bd9015299..423d2bf58 100644 --- a/.evergreen/config/generated/test/require-api-version-rapid.yml +++ b/.evergreen/config/generated/test/require-api-version-rapid.yml @@ -1,6 +1,6 @@ # This file is generated automatically - please edit the "templates/test/require-api-version.yml" template file instead. tasks: - - name: "test-requireApiVersion-rapid" + - name: "test-mongodb-rapid-requireApiVersion" tags: ["standalone", "local", "rapid", "versioned_api"] commands: - func: "bootstrap mongo-orchestration" @@ -15,7 +15,7 @@ tasks: vars: API_VERSION: "1" - - name: "test-acceptApiVersion2-rapid" + - name: "test-mongodb-rapid-acceptApiVersion2" tags: ["standalone", "local", "rapid", "versioned_api"] commands: - func: "bootstrap mongo-orchestration" diff --git a/.evergreen/config/templates/test/require-api-version.yml b/.evergreen/config/templates/test/require-api-version.yml index c567eceee..b313a1924 100644 --- a/.evergreen/config/templates/test/require-api-version.yml +++ b/.evergreen/config/templates/test/require-api-version.yml @@ -1,5 +1,5 @@ tasks: - - name: "test-requireApiVersion-%mongodbVersion%" + - name: "test-mongodb-%mongodbVersion%-requireApiVersion" tags: ["standalone", "local", "%mongodbVersion%", "versioned_api"] commands: - func: "bootstrap mongo-orchestration" @@ -14,7 +14,7 @@ tasks: vars: API_VERSION: "1" - - name: "test-acceptApiVersion2-%mongodbVersion%" + - name: "test-mongodb-%mongodbVersion%-acceptApiVersion2" tags: ["standalone", "local", "%mongodbVersion%", "versioned_api"] commands: - func: "bootstrap mongo-orchestration" diff --git a/tests/ClientFunctionalTest.php b/tests/ClientFunctionalTest.php index adbc0e531..3c04ecd67 100644 --- a/tests/ClientFunctionalTest.php +++ b/tests/ClientFunctionalTest.php @@ -124,7 +124,7 @@ public function testStartSession(): void public function testAddAndRemoveSubscriber(): void { - $client = new Client(static::getUri()); + $client = static::createTestClient(); $addedSubscriber = $this->createMock(CommandSubscriber::class); $addedSubscriber->expects($this->once())->method('commandStarted'); diff --git a/tests/GridFS/BucketFunctionalTest.php b/tests/GridFS/BucketFunctionalTest.php index 6cf38c729..bef444310 100644 --- a/tests/GridFS/BucketFunctionalTest.php +++ b/tests/GridFS/BucketFunctionalTest.php @@ -856,7 +856,8 @@ public function testDanglingOpenWritableStream(): void $code = <<<'PHP' require '%s'; - $client = new \MongoDB\Client(getenv('MONGODB_URI') ?: 'mongodb://127.0.0.1:27017/?serverSelectionTimeoutMS=100'); + require '%s'; + $client = MongoDB\Tests\FunctionalTestCase::createTestClient(); $database = $client->selectDatabase(getenv('MONGODB_DATABASE') ?: 'phplib_test'); $gridfs = $database->selectGridFSBucket(); $stream = $gridfs->openUploadStream('hello.txt', ['disableMD5' => true]); @@ -867,7 +868,14 @@ public function testDanglingOpenWritableStream(): void implode(' ', [ PHP_BINARY, '-r', - escapeshellarg(sprintf($code, __DIR__ . '/../../vendor/autoload.php')), + escapeshellarg( + sprintf( + $code, + __DIR__ . '/../../vendor/autoload.php', + // Include the PHPUnit autoload file to ensure PHPUnit classes can be loaded + __DIR__ . '/../../vendor/bin/.phpunit/phpunit/vendor/autoload.php', + ), + ), '2>&1', ]), $output,