Skip to content

Commit 443bbbf

Browse files
committed
Don't assume document PHP type mapping in FunctionalTestCase
1 parent 3cb9adc commit 443bbbf

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tests/FunctionalTestCase.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@ protected function assertCollectionCount($namespace, $count)
2121
list($databaseName, $collectionName) = explode('.', $namespace, 2);
2222

2323
$cursor = $this->manager->executeCommand($databaseName, new Command(array('count' => $collectionName)));
24-
24+
$cursor->setTypeMap(array('document' => 'array'));
2525
$document = current($cursor->toArray());
26+
2627
$this->assertArrayHasKey('n', $document);
2728
$this->assertEquals($count, $document['n']);
2829
}
@@ -45,6 +46,7 @@ protected function getServerVersion(ReadPreference $readPreference = null)
4546
$readPreference ?: new ReadPreference(ReadPreference::RP_PRIMARY)
4647
);
4748

49+
$cursor->setTypeMap(array('document' => 'array'));
4850
$document = current($cursor->toArray());
4951

5052
return $document['version'];

0 commit comments

Comments
 (0)