Example #1
0
 public function createTestDatabase()
 {
     if (Dba::hasDriver('qdbm')) {
         return new Dba($this->getTempFileName(), Dba::MODE_CREATE | Dba::MODE_TRUNCATE, ['driverName' => 'qdbm']);
     }
     if (Dba::hasDriver('gdbm')) {
         return new Dba($this->getTempFileName(), Dba::MODE_CREATE | Dba::MODE_TRUNCATE, ['driverName' => 'gdbm']);
     }
     if (Dba::hasDriver('inifile')) {
         return new Dba($this->getTempFileName(), Dba::MODE_CREATE | Dba::MODE_TRUNCATE, ['driverName' => 'inifile']);
     }
     $this->markTestSkipped('Driver GDBM, GDBM, Inifile is not supported on this system');
 }
Example #2
0
File: DbaTest.php Project: blar/dba
 /**
  * @expectedException RuntimeException
  */
 public function testAddValue()
 {
     $dba = new Dba($this->getTempFileName(), Dba::MODE_WRITE, ['driverName' => 'cdb']);
     $dba->addValue('foo', 23);
     $dba->addValue('bar', 42);
     $dba->addValue('foobar', 1337);
 }