Skip to content

Commit 20e8f91

Browse files
authored
PHPLIB-652: Convert change streams to unified test format (#908)
* PHPLIB-652: Update unified test runner for change stream tests This bumps the supported schema version to 1.7, but omits support for 1.6 (see: PHPLIB-718). Also includes spec tests for PHPLIB-828 and PHPLIB-829 and introduces support for Collection::rename() operation. Change stream tests synced with mongodb/specifications@bb7a784. Unified spec tests synced with mongodb/specifications@ff0c705. * Remove legacy change stream spec test runner
1 parent dfd77e6 commit 20e8f91

20 files changed

+6553
-4750
lines changed

tests/SpecTests/ChangeStreamsSpecTest.php

-301
This file was deleted.

tests/SpecTests/CommandExpectations.php

-14
Original file line numberDiff line numberDiff line change
@@ -70,20 +70,6 @@ private function __construct(array $events)
7070
}
7171
}
7272

73-
public static function fromChangeStreams(array $expectedEvents)
74-
{
75-
$o = new self($expectedEvents);
76-
77-
$o->ignoreCommandFailed = true;
78-
$o->ignoreCommandSucceeded = true;
79-
/* Change Streams spec tests do not include getMore commands in the
80-
* list of expected events, so ignore any observed events beyond the
81-
* number that are expected. */
82-
$o->ignoreExtraEvents = true;
83-
84-
return $o;
85-
}
86-
8773
public static function fromClientSideEncryption(array $expectedEvents)
8874
{
8975
$o = new self($expectedEvents);

tests/SpecTests/ErrorExpectation.php

-21
Original file line numberDiff line numberDiff line change
@@ -57,27 +57,6 @@ private function __construct()
5757
{
5858
}
5959

60-
public static function fromChangeStreams(stdClass $result)
61-
{
62-
$o = new self();
63-
64-
if (isset($result->error->code)) {
65-
$o->code = $result->error->code;
66-
$o->isExpected = true;
67-
}
68-
69-
if (isset($result->error->errorLabels)) {
70-
if (! self::isArrayOfStrings($result->error->errorLabels)) {
71-
throw InvalidArgumentException::invalidType('errorLabels', $result->error->errorLabels, 'string[]');
72-
}
73-
74-
$o->includedLabels = $result->error->errorLabels;
75-
$o->isExpected = true;
76-
}
77-
78-
return $o;
79-
}
80-
8160
public static function fromClientSideEncryption(stdClass $operation)
8261
{
8362
return self::fromGenericOperation($operation);

0 commit comments

Comments
 (0)