Skip to content

Commit 5e1e5f6

Browse files
committed
assertCommandSucceeded() now accepts a result document
1 parent a006402 commit 5e1e5f6

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

tests/FunctionalTestCase.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,12 @@ protected function assertCollectionCount($namespace, $count)
2727
$this->assertEquals($count, $document['n']);
2828
}
2929

30-
protected function assertCommandSucceeded(Cursor $cursor)
30+
protected function assertCommandSucceeded($document)
3131
{
32-
$document = current($cursor->toArray());
32+
if (is_object($document)) {
33+
$document = get_object_vars($document);
34+
}
35+
3336
$this->assertArrayHasKey('ok', $document);
3437
$this->assertEquals(1, $document['ok']);
3538
}

0 commit comments

Comments
 (0)