/** * @param Pdo|Oci8 $driver * @throws InvalidArgumentException * @return $this */ public function setDriver($driver) { if ($driver instanceof Oci8 || $driver instanceof Pdo && $driver->getDatabasePlatformName() == 'Oracle' || $driver instanceof Pdo && $driver->getDatabasePlatformName() == 'Sqlite' || $driver instanceof \oci8 || $driver instanceof PDO && $driver->getAttribute(PDO::ATTR_DRIVER_NAME) == 'oci') { $this->resource = $driver; return $this; } throw new InvalidArgumentException('$driver must be a Oci8 or Oracle PDO Zend\\Db\\Adapter\\Driver, ' . 'Oci8 instance, or Oci PDO instance'); }
/** * @covers Zend\Db\Adapter\Driver\Oci8\Oci8::getDatabasePlatformName */ public function testGetDatabasePlatformName() { $this->oci8 = new Oci8(array()); $this->assertEquals('Oracle', $this->oci8->getDatabasePlatformName()); $this->assertEquals('Oracle', $this->oci8->getDatabasePlatformName(Oci8::NAME_FORMAT_NATURAL)); }