Skip to content

Commit 6a46e15

Browse files
committed
Assertion args are expected and actual, respectively
1 parent ad50657 commit 6a46e15

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

tests/DocumentationExamplesTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -961,7 +961,7 @@ public function testChangeStreamExample_1_4()
961961
'ns' => (object) ['db' => 'phplib_test', 'coll' => 'inventory'],
962962
'documentKey' => (object) ['_id' => $insertedId]
963963
];
964-
$this->assertEquals($current, $expectedChange);
964+
$this->assertEquals($expectedChange, $current);
965965

966966
// Start Changestream Example 3
967967
$resumeToken = ($current !== null) ? $current->_id : null;
@@ -981,7 +981,7 @@ public function testChangeStreamExample_1_4()
981981
'ns' => (object) ['db' => 'phplib_test', 'coll' => 'inventory'],
982982
'documentKey' => (object) ['_id' => $insertedId]
983983
];
984-
$this->assertEquals($cursor->current(), $expectedChange);
984+
$this->assertEquals($expectedChange, $cursor->current());
985985

986986
// Start Changestream Example 4
987987
$pipeline = [['$match' => ['$or' => [['fullDocument.username' => 'alice'], ['operationType' => 'delete']]]]];

tests/Operation/WatchFunctionalTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function testResume()
4343
'ns' => (object) ['db' => 'phplib_test', 'coll' => 'WatchFunctionalTest.e68b9f01'],
4444
'documentKey' => (object) ['_id' => 2]
4545
]);
46-
$this->assertEquals($changeStream->current(), $expectedResult);
46+
$this->assertEquals($expectedResult, $changeStream->current());
4747

4848
$operation = new DatabaseCommand($this->getDatabaseName(), ["killCursors" => $this->getCollectionName(), "cursors" => [$changeStream->getCursorId()]]);
4949
$operation->execute($this->getPrimaryServer());
@@ -58,7 +58,7 @@ public function testResume()
5858
'ns' => (object) ['db' => 'phplib_test', 'coll' => 'WatchFunctionalTest.e68b9f01'],
5959
'documentKey' => (object) ['_id' => 3]
6060
]);
61-
$this->assertEquals($changeStream->current(), $expectedResult);
61+
$this->assertEquals($expectedResult, $changeStream->current());
6262
}
6363

6464
public function testNoChangeAfterResumeBeforeInsert()
@@ -81,7 +81,7 @@ public function testNoChangeAfterResumeBeforeInsert()
8181
'ns' => (object) ['db' => 'phplib_test', 'coll' => 'WatchFunctionalTest.4a554985'],
8282
'documentKey' => (object) ['_id' => 2]
8383
]);
84-
$this->assertEquals($changeStream->current(), $expectedResult);
84+
$this->assertEquals($expectedResult, $changeStream->current());
8585

8686
$operation = new DatabaseCommand($this->getDatabaseName(), ["killCursors" => $this->getCollectionName(), "cursors" => [$changeStream->getCursorId()]]);
8787
$operation->execute($this->getPrimaryServer());
@@ -99,7 +99,7 @@ public function testNoChangeAfterResumeBeforeInsert()
9999
'ns' => (object) ['db' => 'phplib_test', 'coll' => 'WatchFunctionalTest.4a554985'],
100100
'documentKey' => (object) ['_id' => 3]
101101
]);
102-
$this->assertEquals($changeStream->current(), $expectedResult);
102+
$this->assertEquals($expectedResult, $changeStream->current());
103103
}
104104

105105
public function testResumeAfterKillThenNoOperations()
@@ -171,7 +171,7 @@ public function testNonEmptyPipeline()
171171
'_id' => $changeStream->current()->_id,
172172
'foo' => [0]
173173
]);
174-
$this->assertEquals($changeStream->current(), $expectedResult);
174+
$this->assertEquals($expectedResult, $changeStream->current());
175175
}
176176

177177
public function testCursorWithEmptyBatchNotClosed()

0 commit comments

Comments
 (0)