Skip to content

Commit ad50657

Browse files
committed
Skip change stream tests if connected to a standalone
Change streams require a replica set.
1 parent 689d943 commit ad50657

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

tests/DocumentationExamplesTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use MongoDB\Database;
66
use MongoDB\Driver\Cursor;
7+
use MongoDB\Driver\Server;
78
use MongoDB\Operation\DropCollection;
89
use MongoDB\Operation\DropDatabase;
910

@@ -923,6 +924,10 @@ public function testExample_55_58()
923924

924925
public function testChangeStreamExample_1_4()
925926
{
927+
if ($this->getPrimaryServer()->getType() === Server::TYPE_STANDALONE) {
928+
$this->markTestSkipped('$changeStream is not supported on standalone servers');
929+
}
930+
926931
if (version_compare($this->getFeatureCompatibilityVersion(), '3.6', '<')) {
927932
$this->markTestSkipped('$changeStream is only supported on FCV 3.6 or higher');
928933
}

tests/Operation/WatchFunctionalTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace MongoDB\Tests\Operation;
44

55
use MongoDB\Client;
6+
use MongoDB\Driver\Server;
67
use MongoDB\Operation\DatabaseCommand;
78
use MongoDB\Operation\InsertOne;
89
use MongoDB\Operation\Watch;
@@ -13,6 +14,10 @@ public function setUp()
1314
{
1415
parent::setUp();
1516

17+
if ($this->getPrimaryServer()->getType() === Server::TYPE_STANDALONE) {
18+
$this->markTestSkipped('$changeStream is not supported on standalone servers');
19+
}
20+
1621
if (version_compare($this->getFeatureCompatibilityVersion(), '3.6', '<')) {
1722
$this->markTestSkipped('$changeStream is only supported on FCV 3.6 or higher');
1823
}

0 commit comments

Comments
 (0)