With no parameter, checks to see if the mongo extension is installed. With a parameter,
queries for a specific supported feature.
public function skip() { $this->skipIf(!MongoDb::enabled(), 'MongoDb is not enabled'); $this->skipIf(!CouchDb::enabled(), 'CouchDb is not enabled'); }
public function testArrayConversion() { $this->skipIf(!MongoDb::enabled(), "MongoDB not enabled, skipping conversion tests."); $time = time(); $doc = new Document(array('data' => array('_id' => new MongoId(), 'date' => new MongoDate($time)))); $result = $doc->data(); $this->assertPattern('/^[a-f0-9]{24}$/', $result['_id']); $this->assertEqual($time, $result['date']); }
public function testEnabled() { $this->assertTrue(MongoDb::enabled()); }
public function testEnabled() { $this->assertTrue(MongoDb::enabled()); $this->assertTrue(MongoDb::enabled('arrays')); $this->assertTrue(MongoDb::enabled('booleans')); $this->assertTrue(MongoDb::enabled('relationships')); }