Skip to content

Commit 7e3bfff

Browse files
authored
PHPLIB-1080: Spec tests for command events databaseName property (#1309)
Bumps PHPC requirement to 1.19 for PHPC-2255.
1 parent afcb801 commit 7e3bfff

File tree

9 files changed

+34
-19
lines changed

9 files changed

+34
-19
lines changed

.evergreen/config/generated/build/build-php-7.4.yml

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.evergreen/config/generated/build/build-php-8.0.yml

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.evergreen/config/generated/build/build-php-8.1.yml

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.evergreen/config/generated/build/build-php-8.2.yml

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.evergreen/config/generated/build/build-php-8.3.yml

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.evergreen/config/templates/build/build-extension.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ tasks:
1515
PHP_VERSION: "%phpVersion%"
1616
- func: "compile extension"
1717
vars:
18-
EXTENSION_VERSION: "1.18.0"
18+
EXTENSION_VERSION: "1.19.0"
1919
- func: "upload extension"
2020
- name: "build-php-%phpVersion%-next-stable"
2121
tags: ["build", "php%phpVersion%", "next-stable"]
@@ -25,7 +25,7 @@ tasks:
2525
PHP_VERSION: "%phpVersion%"
2626
- func: "compile extension"
2727
vars:
28-
EXTENSION_BRANCH: "v1.18"
28+
EXTENSION_BRANCH: "v1.19"
2929
- func: "upload extension"
3030
- name: "build-php-%phpVersion%-next-minor"
3131
tags: ["build", "php%phpVersion%", "next-minor"]

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"php": "^7.4 || ^8.0",
1414
"ext-hash": "*",
1515
"ext-json": "*",
16-
"ext-mongodb": "^1.18.0",
16+
"ext-mongodb": "^1.19.0",
1717
"composer-runtime-api": "^2.0",
1818
"psr/log": "^1.1.4|^2|^3",
1919
"symfony/polyfill-php80": "^1.27",

tests/UnifiedSpecTests/EventObserver.php

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ private function assertCommandStartedEvent(CommandStartedEvent $actual, stdClass
275275

276276
private function assertCommandSucceededEvent(CommandSucceededEvent $actual, stdClass $expected, string $message): void
277277
{
278-
Util::assertHasOnlyKeys($expected, ['reply', 'commandName', 'hasServiceId', 'hasServerConnectionId']);
278+
Util::assertHasOnlyKeys($expected, ['reply', 'commandName', 'databaseName', 'hasServiceId', 'hasServerConnectionId']);
279279

280280
if (isset($expected->reply)) {
281281
assertIsObject($expected->reply);
@@ -288,6 +288,11 @@ private function assertCommandSucceededEvent(CommandSucceededEvent $actual, stdC
288288
assertSame($actual->getCommandName(), $expected->commandName, $message . ': commandName matches');
289289
}
290290

291+
if (isset($expected->databaseName)) {
292+
assertIsString($expected->databaseName);
293+
assertSame($actual->getDatabaseName(), $expected->databaseName, $message . ': databaseName matches');
294+
}
295+
291296
if (isset($expected->hasServiceId)) {
292297
assertIsBool($expected->hasServiceId);
293298
assertSame($actual->getServiceId() !== null, $expected->hasServiceId, $message . ': hasServiceId matches');
@@ -301,13 +306,18 @@ private function assertCommandSucceededEvent(CommandSucceededEvent $actual, stdC
301306

302307
private function assertCommandFailedEvent(CommandFailedEvent $actual, stdClass $expected, string $message): void
303308
{
304-
Util::assertHasOnlyKeys($expected, ['commandName', 'hasServiceId', 'hasServerConnectionId']);
309+
Util::assertHasOnlyKeys($expected, ['commandName', 'databaseName', 'hasServiceId', 'hasServerConnectionId']);
305310

306311
if (isset($expected->commandName)) {
307312
assertIsString($expected->commandName);
308313
assertSame($actual->getCommandName(), $expected->commandName, $message . ': commandName matches');
309314
}
310315

316+
if (isset($expected->databaseName)) {
317+
assertIsString($expected->databaseName);
318+
assertSame($actual->getDatabaseName(), $expected->databaseName, $message . ': databaseName matches');
319+
}
320+
311321
if (isset($expected->hasServiceId)) {
312322
assertIsBool($expected->hasServiceId);
313323
assertSame($actual->getServiceId() !== null, $expected->hasServiceId, $message . ': hasServiceId matches');

tests/UnifiedSpecTests/UnifiedTestRunner.php

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,16 @@ final class UnifiedTestRunner
5555

5656
public const MIN_SCHEMA_VERSION = '1.0';
5757

58-
/* Note: This is necessary to support expectedError.errorResponse from 1.12;
59-
* however, syntax from 1.9, 1.10, and 1.11 has not been fully implemented.
60-
* Syntax for 1.9 is partially implemented (createEntities operation).
58+
/**
59+
* Support for the following schema versions is incomplete:
60+
*
61+
* - 1.9: Only createEntities operation is implemented
62+
* - 1.10: Not implemented
63+
* - 1.11: Not implemented, but CMAP is not applicable
64+
* - 1.13: Not implemented
65+
* - 1.14: Not implemented
6166
*/
62-
public const MAX_SCHEMA_VERSION = '1.12';
67+
public const MAX_SCHEMA_VERSION = '1.15';
6368

6469
private Client $internalClient;
6570

0 commit comments

Comments
 (0)