Esempio n. 1
0
 public function testLoadOptions()
 {
     $db = new DbConnection();
     $db->loadOptions(__DIR__ . '/config/db.json');
     $this->assertEquals('12345', $db->getOption('password'));
     $this->assertEquals('some-host:3306', $db->getOption('host'));
     $this->assertEquals('iso-8859-1', $db->getOption('encoding'));
 }
 public function testDefineOptions()
 {
     $db = new DbConnection(['password' => 'some password', 'host' => 'some host']);
     $this->assertEquals('some password', $db->getOption('password'));
     $this->assertEquals('some host', $db->getOption('host'));
 }