public function testListCollections() { $ns = $this->object->selectCollection('system.namespaces'); for ($i = 0; $i < 10; $i++) { $c = $this->object->selectCollection("x{$i}"); $c->insert((object) array("foo" => "bar"), array("safe" => true)); } $list = $this->object->listCollections(); for ($i = 0; $i < 10; $i++) { $this->assertTrue($list[$i] instanceof MongoCollection); if (!preg_match("/5\\.1\\../", phpversion())) { $this->assertTrue(in_array("phpunit.x{$i}", $list)); } } }