enabled() public static method

With no parameter, always returns true, since CouchDB only depends on HTTP. With a parameter, queries for a specific supported feature.
public static enabled ( string $feature = null ) : boolean
$feature string Test for support for a specific feature, i.e. `"transactions"` or `"arrays"`.
return boolean Returns `true` if the particular feature support is enabled, otherwise `false`.
示例#1
0
 public function skip()
 {
     $this->skipIf(!MongoDb::enabled(), 'MongoDb is not enabled');
     $this->skipIf(!CouchDb::enabled(), 'CouchDb is not enabled');
 }
示例#2
0
 public function testEnabled()
 {
     $this->assertEqual(CouchDb::enabled(), true);
     $this->assertEqual(CouchDb::enabled('arrays'), true);
     $this->assertEqual(CouchDb::enabled('transactions'), false);
     $this->assertEqual(CouchDb::enabled('booleans'), true);
     $this->assertEqual(CouchDb::enabled('relationships'), false);
 }