Skip to content

Commit 860e789

Browse files
committed
PHPLIB-1080: Spec tests for command events databaseName property
1 parent cbc8104 commit 860e789

File tree

2 files changed

+19
-4
lines changed

2 files changed

+19
-4
lines changed

tests/UnifiedSpecTests/EventObserver.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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');
@@ -308,6 +313,11 @@ private function assertCommandFailedEvent(CommandFailedEvent $actual, stdClass $
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)