/** * @inheritdoc * * @throws ParserConditionNotSatisfiedException * @throws ParserRuntimeException * @throws UnexpectedValueException */ protected function getAdapter() : AdapterInterface { if ($this->adapter === null) { $databaseFile = $this->getDatabasePath(); $adapter = AdapterFactory::getInstance($databaseFile); $this->setAdapter($adapter); } return $this->adapter; }
/** * @expectedException \Crossjoin\Browscap\Exception\ParserConditionNotSatisfiedException * * @covers ::getInstanceByClassName * * @throws InvalidArgumentException * @throws ParserConditionNotSatisfiedException * @throws UnexpectedValueException */ public function testUnavailableAdapter() { AdapterFactory::setAdapterClasses(['\\Crossjoin\\Browscap\\Tests\\Mock\\Parser\\Sqlite\\Adapter\\PdoUnavailable']); AdapterFactory::getInstance('dummy.sqlite'); }