public function testDeleteIndex() { $idx = $this->object->db->selectCollection('system.indexes'); $this->object->ensureIndex('foo'); $this->object->ensureIndex((object)array('foo' => -1)); $num = iterator_count($idx->find((object)array('ns' => 'phpunit.c'))); $this->assertEquals($num, 3); $this->object->deleteIndex(null); $num = iterator_count($idx->find((object)array('ns' => 'phpunit.c'))); $this->assertEquals($num, 3); $this->object->deleteIndex((object)array('foo' => 1)); $num = iterator_count($idx->find((object)array('ns' => 'phpunit.c'))); $this->assertEquals($num, 2); $this->object->deleteIndex('foo'); $num = iterator_count($idx->find((object)array('ns' => 'phpunit.c'))); $this->assertEquals($num, 2); $this->object->deleteIndex((object)array('foo' => -1)); $num = iterator_count($idx->find((object)array('ns' => 'phpunit.c'))); $this->assertEquals($num, 1); }