Rework detection of loaded PHP extensions in tests

parent 60f9ff70
...@@ -5,8 +5,10 @@ namespace Doctrine\Tests\DBAL\Driver\IBMDB2; ...@@ -5,8 +5,10 @@ namespace Doctrine\Tests\DBAL\Driver\IBMDB2;
use Doctrine\DBAL\Driver\IBMDB2\DB2Connection; use Doctrine\DBAL\Driver\IBMDB2\DB2Connection;
use Doctrine\Tests\DbalTestCase; use Doctrine\Tests\DbalTestCase;
use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\MockObject\MockObject;
use function extension_loaded;
/**
* @requires extension ibm_db2
*/
class DB2ConnectionTest extends DbalTestCase class DB2ConnectionTest extends DbalTestCase
{ {
/** /**
...@@ -18,10 +20,6 @@ class DB2ConnectionTest extends DbalTestCase ...@@ -18,10 +20,6 @@ class DB2ConnectionTest extends DbalTestCase
protected function setUp() : void protected function setUp() : void
{ {
if (! extension_loaded('ibm_db2')) {
$this->markTestSkipped('ibm_db2 is not installed.');
}
parent::setUp(); parent::setUp();
$this->connectionMock = $this->getMockBuilder(DB2Connection::class) $this->connectionMock = $this->getMockBuilder(DB2Connection::class)
......
...@@ -7,10 +7,12 @@ use Doctrine\DBAL\Driver\Mysqli\MysqliException; ...@@ -7,10 +7,12 @@ use Doctrine\DBAL\Driver\Mysqli\MysqliException;
use Doctrine\DBAL\Platforms\MySqlPlatform; use Doctrine\DBAL\Platforms\MySqlPlatform;
use Doctrine\Tests\DbalFunctionalTestCase; use Doctrine\Tests\DbalFunctionalTestCase;
use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\MockObject\MockObject;
use function extension_loaded;
use function restore_error_handler; use function restore_error_handler;
use function set_error_handler; use function set_error_handler;
/**
* @requires extension mysqli
*/
class MysqliConnectionTest extends DbalFunctionalTestCase class MysqliConnectionTest extends DbalFunctionalTestCase
{ {
/** /**
...@@ -22,10 +24,6 @@ class MysqliConnectionTest extends DbalFunctionalTestCase ...@@ -22,10 +24,6 @@ class MysqliConnectionTest extends DbalFunctionalTestCase
protected function setUp() : void protected function setUp() : void
{ {
if (! extension_loaded('mysqli')) {
$this->markTestSkipped('mysqli is not installed.');
}
parent::setUp(); parent::setUp();
if (! $this->connection->getDatabasePlatform() instanceof MySqlPlatform) { if (! $this->connection->getDatabasePlatform() instanceof MySqlPlatform) {
......
...@@ -5,8 +5,10 @@ namespace Doctrine\Tests\DBAL\Driver\OCI8; ...@@ -5,8 +5,10 @@ namespace Doctrine\Tests\DBAL\Driver\OCI8;
use Doctrine\DBAL\Driver\OCI8\OCI8Connection; use Doctrine\DBAL\Driver\OCI8\OCI8Connection;
use Doctrine\Tests\DbalTestCase; use Doctrine\Tests\DbalTestCase;
use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\MockObject\MockObject;
use function extension_loaded;
/**
* @requires extension oci8
*/
class OCI8ConnectionTest extends DbalTestCase class OCI8ConnectionTest extends DbalTestCase
{ {
/** /**
...@@ -18,10 +20,6 @@ class OCI8ConnectionTest extends DbalTestCase ...@@ -18,10 +20,6 @@ class OCI8ConnectionTest extends DbalTestCase
protected function setUp() : void protected function setUp() : void
{ {
if (! extension_loaded('oci8')) {
$this->markTestSkipped('oci8 is not installed.');
}
parent::setUp(); parent::setUp();
$this->connectionMock = $this->getMockBuilder(OCI8Connection::class) $this->connectionMock = $this->getMockBuilder(OCI8Connection::class)
......
...@@ -7,19 +7,12 @@ use Doctrine\DBAL\Driver\OCI8\OCI8Exception; ...@@ -7,19 +7,12 @@ use Doctrine\DBAL\Driver\OCI8\OCI8Exception;
use Doctrine\DBAL\Driver\OCI8\OCI8Statement; use Doctrine\DBAL\Driver\OCI8\OCI8Statement;
use Doctrine\Tests\DbalTestCase; use Doctrine\Tests\DbalTestCase;
use ReflectionProperty; use ReflectionProperty;
use function extension_loaded;
/**
* @requires extension oci8
*/
class OCI8StatementTest extends DbalTestCase class OCI8StatementTest extends DbalTestCase
{ {
protected function setUp() : void
{
if (! extension_loaded('oci8')) {
$this->markTestSkipped('oci8 is not installed.');
}
parent::setUp();
}
/** /**
* This scenario shows that when the first parameter is not null * This scenario shows that when the first parameter is not null
* it properly sets $hasZeroIndex to 1 and calls bindValue starting at 1. * it properly sets $hasZeroIndex to 1 and calls bindValue starting at 1.
......
...@@ -5,8 +5,10 @@ namespace Doctrine\Tests\DBAL\Driver; ...@@ -5,8 +5,10 @@ namespace Doctrine\Tests\DBAL\Driver;
use Doctrine\DBAL\Driver\PDOException; use Doctrine\DBAL\Driver\PDOException;
use Doctrine\Tests\DbalTestCase; use Doctrine\Tests\DbalTestCase;
use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\MockObject\MockObject;
use function extension_loaded;
/**
* @requires extension pdo
*/
class PDOExceptionTest extends DbalTestCase class PDOExceptionTest extends DbalTestCase
{ {
public const ERROR_CODE = 666; public const ERROR_CODE = 666;
...@@ -31,10 +33,6 @@ class PDOExceptionTest extends DbalTestCase ...@@ -31,10 +33,6 @@ class PDOExceptionTest extends DbalTestCase
protected function setUp() : void protected function setUp() : void
{ {
if (! extension_loaded('PDO')) {
$this->markTestSkipped('PDO is not installed.');
}
parent::setUp(); parent::setUp();
$this->wrappedException = new \PDOException(self::MESSAGE, self::SQLSTATE); $this->wrappedException = new \PDOException(self::MESSAGE, self::SQLSTATE);
......
...@@ -5,8 +5,10 @@ namespace Doctrine\Tests\DBAL\Driver\SQLAnywhere; ...@@ -5,8 +5,10 @@ namespace Doctrine\Tests\DBAL\Driver\SQLAnywhere;
use Doctrine\DBAL\Driver\SQLAnywhere\SQLAnywhereConnection; use Doctrine\DBAL\Driver\SQLAnywhere\SQLAnywhereConnection;
use Doctrine\Tests\DbalTestCase; use Doctrine\Tests\DbalTestCase;
use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\MockObject\MockObject;
use function extension_loaded;
/**
* @requires extension sqlanywhere
*/
class SQLAnywhereConnectionTest extends DbalTestCase class SQLAnywhereConnectionTest extends DbalTestCase
{ {
/** /**
...@@ -18,10 +20,6 @@ class SQLAnywhereConnectionTest extends DbalTestCase ...@@ -18,10 +20,6 @@ class SQLAnywhereConnectionTest extends DbalTestCase
protected function setUp() : void protected function setUp() : void
{ {
if (! extension_loaded('sqlanywhere')) {
$this->markTestSkipped('sqlanywhere is not installed.');
}
parent::setUp(); parent::setUp();
$this->connectionMock = $this->getMockBuilder(SQLAnywhereConnection::class) $this->connectionMock = $this->getMockBuilder(SQLAnywhereConnection::class)
......
...@@ -5,7 +5,6 @@ namespace Doctrine\Tests\DBAL\Driver\SQLSrv; ...@@ -5,7 +5,6 @@ namespace Doctrine\Tests\DBAL\Driver\SQLSrv;
use Doctrine\DBAL\Driver\SQLSrv\SQLSrvConnection; use Doctrine\DBAL\Driver\SQLSrv\SQLSrvConnection;
use Doctrine\Tests\DbalTestCase; use Doctrine\Tests\DbalTestCase;
use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\MockObject\MockObject;
use function extension_loaded;
class SQLSrvConnectionTest extends DbalTestCase class SQLSrvConnectionTest extends DbalTestCase
{ {
...@@ -16,12 +15,11 @@ class SQLSrvConnectionTest extends DbalTestCase ...@@ -16,12 +15,11 @@ class SQLSrvConnectionTest extends DbalTestCase
*/ */
private $connectionMock; private $connectionMock;
/**
* @requires extension sqlsrv
*/
protected function setUp() : void protected function setUp() : void
{ {
if (! extension_loaded('sqlsrv')) {
$this->markTestSkipped('sqlsrv is not installed.');
}
parent::setUp(); parent::setUp();
$this->connectionMock = $this->getMockBuilder(SQLSrvConnection::class) $this->connectionMock = $this->getMockBuilder(SQLSrvConnection::class)
......
...@@ -5,16 +5,14 @@ namespace Doctrine\Tests\DBAL\Functional\Driver\IBMDB2; ...@@ -5,16 +5,14 @@ namespace Doctrine\Tests\DBAL\Functional\Driver\IBMDB2;
use Doctrine\DBAL\Driver; use Doctrine\DBAL\Driver;
use Doctrine\DBAL\Driver\IBMDB2\DB2Driver; use Doctrine\DBAL\Driver\IBMDB2\DB2Driver;
use Doctrine\Tests\DBAL\Functional\Driver\AbstractDriverTest; use Doctrine\Tests\DBAL\Functional\Driver\AbstractDriverTest;
use function extension_loaded;
/**
* @requires extension ibm_db2
*/
class DB2DriverTest extends AbstractDriverTest class DB2DriverTest extends AbstractDriverTest
{ {
protected function setUp() : void protected function setUp() : void
{ {
if (! extension_loaded('ibm_db2')) {
$this->markTestSkipped('ibm_db2 is not installed.');
}
parent::setUp(); parent::setUp();
if ($this->connection->getDriver() instanceof DB2Driver) { if ($this->connection->getDriver() instanceof DB2Driver) {
......
...@@ -7,16 +7,14 @@ namespace Doctrine\Tests\DBAL\Functional\Driver\IBMDB2; ...@@ -7,16 +7,14 @@ namespace Doctrine\Tests\DBAL\Functional\Driver\IBMDB2;
use Doctrine\DBAL\Driver\IBMDB2\DB2Driver; use Doctrine\DBAL\Driver\IBMDB2\DB2Driver;
use Doctrine\Tests\DbalFunctionalTestCase; use Doctrine\Tests\DbalFunctionalTestCase;
use PHPUnit\Framework\Error\Notice; use PHPUnit\Framework\Error\Notice;
use function extension_loaded;
/**
* @requires extension ibm_db2
*/
class DB2StatementTest extends DbalFunctionalTestCase class DB2StatementTest extends DbalFunctionalTestCase
{ {
protected function setUp() : void protected function setUp() : void
{ {
if (! extension_loaded('ibm_db2')) {
$this->markTestSkipped('ibm_db2 is not installed.');
}
parent::setUp(); parent::setUp();
if ($this->connection->getDriver() instanceof DB2Driver) { if ($this->connection->getDriver() instanceof DB2Driver) {
......
...@@ -7,17 +7,15 @@ use Doctrine\DBAL\Driver\Mysqli\MysqliConnection; ...@@ -7,17 +7,15 @@ use Doctrine\DBAL\Driver\Mysqli\MysqliConnection;
use Doctrine\DBAL\Driver\Mysqli\MysqliException; use Doctrine\DBAL\Driver\Mysqli\MysqliException;
use Doctrine\Tests\DbalFunctionalTestCase; use Doctrine\Tests\DbalFunctionalTestCase;
use Doctrine\Tests\TestUtil; use Doctrine\Tests\TestUtil;
use function extension_loaded;
use const MYSQLI_OPT_CONNECT_TIMEOUT; use const MYSQLI_OPT_CONNECT_TIMEOUT;
/**
* @requires extension mysqli
*/
class ConnectionTest extends DbalFunctionalTestCase class ConnectionTest extends DbalFunctionalTestCase
{ {
protected function setUp() : void protected function setUp() : void
{ {
if (! extension_loaded('mysqli')) {
$this->markTestSkipped('mysqli is not installed.');
}
parent::setUp(); parent::setUp();
if ($this->connection->getDriver() instanceof Driver) { if ($this->connection->getDriver() instanceof Driver) {
......
...@@ -5,16 +5,14 @@ namespace Doctrine\Tests\DBAL\Functional\Driver\Mysqli; ...@@ -5,16 +5,14 @@ namespace Doctrine\Tests\DBAL\Functional\Driver\Mysqli;
use Doctrine\DBAL\Driver as DriverInterface; use Doctrine\DBAL\Driver as DriverInterface;
use Doctrine\DBAL\Driver\Mysqli\Driver; use Doctrine\DBAL\Driver\Mysqli\Driver;
use Doctrine\Tests\DBAL\Functional\Driver\AbstractDriverTest; use Doctrine\Tests\DBAL\Functional\Driver\AbstractDriverTest;
use function extension_loaded;
/**
* @requires extension mysqli
*/
class DriverTest extends AbstractDriverTest class DriverTest extends AbstractDriverTest
{ {
protected function setUp() : void protected function setUp() : void
{ {
if (! extension_loaded('mysqli')) {
$this->markTestSkipped('mysqli is not installed.');
}
parent::setUp(); parent::setUp();
if ($this->connection->getDriver() instanceof Driver) { if ($this->connection->getDriver() instanceof Driver) {
......
...@@ -5,16 +5,14 @@ namespace Doctrine\Tests\DBAL\Functional\Driver\OCI8; ...@@ -5,16 +5,14 @@ namespace Doctrine\Tests\DBAL\Functional\Driver\OCI8;
use Doctrine\DBAL\Driver as DriverInterface; use Doctrine\DBAL\Driver as DriverInterface;
use Doctrine\DBAL\Driver\OCI8\Driver; use Doctrine\DBAL\Driver\OCI8\Driver;
use Doctrine\Tests\DBAL\Functional\Driver\AbstractDriverTest; use Doctrine\Tests\DBAL\Functional\Driver\AbstractDriverTest;
use function extension_loaded;
/**
* @requires extension oci8
*/
class DriverTest extends AbstractDriverTest class DriverTest extends AbstractDriverTest
{ {
protected function setUp() : void protected function setUp() : void
{ {
if (! extension_loaded('oci8')) {
$this->markTestSkipped('oci8 is not installed.');
}
parent::setUp(); parent::setUp();
if ($this->connection->getDriver() instanceof Driver) { if ($this->connection->getDriver() instanceof Driver) {
......
...@@ -6,8 +6,10 @@ use Doctrine\DBAL\Driver\OCI8\Driver; ...@@ -6,8 +6,10 @@ use Doctrine\DBAL\Driver\OCI8\Driver;
use Doctrine\DBAL\Driver\OCI8\OCI8Connection; use Doctrine\DBAL\Driver\OCI8\OCI8Connection;
use Doctrine\DBAL\Schema\Table; use Doctrine\DBAL\Schema\Table;
use Doctrine\Tests\DbalFunctionalTestCase; use Doctrine\Tests\DbalFunctionalTestCase;
use function extension_loaded;
/**
* @requires extension oci8
*/
class OCI8ConnectionTest extends DbalFunctionalTestCase class OCI8ConnectionTest extends DbalFunctionalTestCase
{ {
/** @var OCI8Connection */ /** @var OCI8Connection */
...@@ -15,10 +17,6 @@ class OCI8ConnectionTest extends DbalFunctionalTestCase ...@@ -15,10 +17,6 @@ class OCI8ConnectionTest extends DbalFunctionalTestCase
protected function setUp() : void protected function setUp() : void
{ {
if (! extension_loaded('oci8')) {
$this->markTestSkipped('oci8 is not installed.');
}
parent::setUp(); parent::setUp();
if (! $this->connection->getDriver() instanceof Driver) { if (! $this->connection->getDriver() instanceof Driver) {
......
...@@ -4,16 +4,14 @@ namespace Doctrine\Tests\DBAL\Functional\Driver\OCI8; ...@@ -4,16 +4,14 @@ namespace Doctrine\Tests\DBAL\Functional\Driver\OCI8;
use Doctrine\DBAL\Driver\OCI8\Driver; use Doctrine\DBAL\Driver\OCI8\Driver;
use Doctrine\Tests\DbalFunctionalTestCase; use Doctrine\Tests\DbalFunctionalTestCase;
use function extension_loaded;
/**
* @requires extension oci8
*/
class StatementTest extends DbalFunctionalTestCase class StatementTest extends DbalFunctionalTestCase
{ {
protected function setUp() : void protected function setUp() : void
{ {
if (! extension_loaded('oci8')) {
$this->markTestSkipped('oci8 is not installed.');
}
parent::setUp(); parent::setUp();
if ($this->connection->getDriver() instanceof Driver) { if ($this->connection->getDriver() instanceof Driver) {
......
...@@ -9,10 +9,12 @@ use Doctrine\DBAL\Driver\PDOPgSql\Driver as PDOPgSQLDriver; ...@@ -9,10 +9,12 @@ use Doctrine\DBAL\Driver\PDOPgSql\Driver as PDOPgSQLDriver;
use Doctrine\DBAL\Driver\PDOSqlsrv\Driver as PDOSQLSRVDriver; use Doctrine\DBAL\Driver\PDOSqlsrv\Driver as PDOSQLSRVDriver;
use Doctrine\Tests\DbalFunctionalTestCase; use Doctrine\Tests\DbalFunctionalTestCase;
use PDO; use PDO;
use function extension_loaded;
use function get_class; use function get_class;
use function sprintf; use function sprintf;
/**
* @requires extension pdo
*/
class PDOConnectionTest extends DbalFunctionalTestCase class PDOConnectionTest extends DbalFunctionalTestCase
{ {
/** /**
...@@ -24,10 +26,6 @@ class PDOConnectionTest extends DbalFunctionalTestCase ...@@ -24,10 +26,6 @@ class PDOConnectionTest extends DbalFunctionalTestCase
protected function setUp() : void protected function setUp() : void
{ {
if (! extension_loaded('PDO')) {
$this->markTestSkipped('PDO is not installed.');
}
parent::setUp(); parent::setUp();
$this->driverConnection = $this->connection->getWrappedConnection(); $this->driverConnection = $this->connection->getWrappedConnection();
......
...@@ -5,16 +5,14 @@ namespace Doctrine\Tests\DBAL\Functional\Driver\PDOMySql; ...@@ -5,16 +5,14 @@ namespace Doctrine\Tests\DBAL\Functional\Driver\PDOMySql;
use Doctrine\DBAL\Driver as DriverInterface; use Doctrine\DBAL\Driver as DriverInterface;
use Doctrine\DBAL\Driver\PDOMySql\Driver; use Doctrine\DBAL\Driver\PDOMySql\Driver;
use Doctrine\Tests\DBAL\Functional\Driver\AbstractDriverTest; use Doctrine\Tests\DBAL\Functional\Driver\AbstractDriverTest;
use function extension_loaded;
/**
* @requires extension pdo_mysql
*/
class DriverTest extends AbstractDriverTest class DriverTest extends AbstractDriverTest
{ {
protected function setUp() : void protected function setUp() : void
{ {
if (! extension_loaded('pdo_mysql')) {
$this->markTestSkipped('pdo_mysql is not installed.');
}
parent::setUp(); parent::setUp();
if ($this->connection->getDriver() instanceof Driver) { if ($this->connection->getDriver() instanceof Driver) {
......
...@@ -5,16 +5,14 @@ namespace Doctrine\Tests\DBAL\Functional\Driver\PDOOracle; ...@@ -5,16 +5,14 @@ namespace Doctrine\Tests\DBAL\Functional\Driver\PDOOracle;
use Doctrine\DBAL\Driver as DriverInterface; use Doctrine\DBAL\Driver as DriverInterface;
use Doctrine\DBAL\Driver\PDOOracle\Driver; use Doctrine\DBAL\Driver\PDOOracle\Driver;
use Doctrine\Tests\DBAL\Functional\Driver\AbstractDriverTest; use Doctrine\Tests\DBAL\Functional\Driver\AbstractDriverTest;
use function extension_loaded;
/**
* @requires extension pdo_oci
*/
class DriverTest extends AbstractDriverTest class DriverTest extends AbstractDriverTest
{ {
protected function setUp() : void protected function setUp() : void
{ {
if (! extension_loaded('PDO_OCI')) {
$this->markTestSkipped('PDO_OCI is not installed.');
}
parent::setUp(); parent::setUp();
if ($this->connection->getDriver() instanceof Driver) { if ($this->connection->getDriver() instanceof Driver) {
......
...@@ -8,18 +8,16 @@ use Doctrine\DBAL\Driver\PDOPgSql\Driver; ...@@ -8,18 +8,16 @@ use Doctrine\DBAL\Driver\PDOPgSql\Driver;
use Doctrine\Tests\DBAL\Functional\Driver\AbstractDriverTest; use Doctrine\Tests\DBAL\Functional\Driver\AbstractDriverTest;
use Doctrine\Tests\TestUtil; use Doctrine\Tests\TestUtil;
use function array_key_exists; use function array_key_exists;
use function extension_loaded;
use function microtime; use function microtime;
use function sprintf; use function sprintf;
/**
* @requires extension pdo_pgsql
*/
class DriverTest extends AbstractDriverTest class DriverTest extends AbstractDriverTest
{ {
protected function setUp() : void protected function setUp() : void
{ {
if (! extension_loaded('pdo_pgsql')) {
$this->markTestSkipped('pdo_pgsql is not installed.');
}
parent::setUp(); parent::setUp();
if ($this->connection->getDriver() instanceof Driver) { if ($this->connection->getDriver() instanceof Driver) {
......
...@@ -6,16 +6,14 @@ use Doctrine\DBAL\DriverManager; ...@@ -6,16 +6,14 @@ use Doctrine\DBAL\DriverManager;
use Doctrine\DBAL\FetchMode; use Doctrine\DBAL\FetchMode;
use Doctrine\DBAL\Platforms\PostgreSqlPlatform; use Doctrine\DBAL\Platforms\PostgreSqlPlatform;
use Doctrine\Tests\DbalFunctionalTestCase; use Doctrine\Tests\DbalFunctionalTestCase;
use function extension_loaded;
/**
* @requires extension pdo_pgsql
*/
class PDOPgsqlConnectionTest extends DbalFunctionalTestCase class PDOPgsqlConnectionTest extends DbalFunctionalTestCase
{ {
protected function setUp() : void protected function setUp() : void
{ {
if (! extension_loaded('pdo_pgsql')) {
$this->markTestSkipped('pdo_pgsql is not loaded.');
}
parent::setUp(); parent::setUp();
if ($this->connection->getDatabasePlatform() instanceof PostgreSqlPlatform) { if ($this->connection->getDatabasePlatform() instanceof PostgreSqlPlatform) {
......
...@@ -5,16 +5,14 @@ namespace Doctrine\Tests\DBAL\Functional\Driver\PDOSqlite; ...@@ -5,16 +5,14 @@ namespace Doctrine\Tests\DBAL\Functional\Driver\PDOSqlite;
use Doctrine\DBAL\Driver as DriverInterface; use Doctrine\DBAL\Driver as DriverInterface;
use Doctrine\DBAL\Driver\PDOSqlite\Driver; use Doctrine\DBAL\Driver\PDOSqlite\Driver;
use Doctrine\Tests\DBAL\Functional\Driver\AbstractDriverTest; use Doctrine\Tests\DBAL\Functional\Driver\AbstractDriverTest;
use function extension_loaded;
/**
* @requires extension pdo_sqlite
*/
class DriverTest extends AbstractDriverTest class DriverTest extends AbstractDriverTest
{ {
protected function setUp() : void protected function setUp() : void
{ {
if (! extension_loaded('pdo_sqlite')) {
$this->markTestSkipped('pdo_sqlite is not installed.');
}
parent::setUp(); parent::setUp();
if ($this->connection->getDriver() instanceof Driver) { if ($this->connection->getDriver() instanceof Driver) {
......
...@@ -8,16 +8,14 @@ use Doctrine\DBAL\Driver\PDOSqlsrv\Driver; ...@@ -8,16 +8,14 @@ use Doctrine\DBAL\Driver\PDOSqlsrv\Driver;
use Doctrine\Tests\DBAL\Functional\Driver\AbstractDriverTest; use Doctrine\Tests\DBAL\Functional\Driver\AbstractDriverTest;
use Doctrine\Tests\TestUtil; use Doctrine\Tests\TestUtil;
use PDO; use PDO;
use function extension_loaded;
/**
* @requires extension pdo_sqlsrv
*/
class DriverTest extends AbstractDriverTest class DriverTest extends AbstractDriverTest
{ {
protected function setUp() : void protected function setUp() : void
{ {
if (! extension_loaded('pdo_sqlsrv')) {
$this->markTestSkipped('pdo_sqlsrv is not installed.');
}
parent::setUp(); parent::setUp();
if ($this->connection->getDriver() instanceof Driver) { if ($this->connection->getDriver() instanceof Driver) {
......
...@@ -5,16 +5,14 @@ namespace Doctrine\Tests\DBAL\Functional\Driver\SQLAnywhere; ...@@ -5,16 +5,14 @@ namespace Doctrine\Tests\DBAL\Functional\Driver\SQLAnywhere;
use Doctrine\DBAL\Driver\SQLAnywhere\Driver; use Doctrine\DBAL\Driver\SQLAnywhere\Driver;
use Doctrine\DBAL\DriverManager; use Doctrine\DBAL\DriverManager;
use Doctrine\Tests\DbalFunctionalTestCase; use Doctrine\Tests\DbalFunctionalTestCase;
use function extension_loaded;
/**
* @requires extension sqlanywhere
*/
class ConnectionTest extends DbalFunctionalTestCase class ConnectionTest extends DbalFunctionalTestCase
{ {
protected function setUp() : void protected function setUp() : void
{ {
if (! extension_loaded('sqlanywhere')) {
$this->markTestSkipped('sqlanywhere is not installed.');
}
parent::setUp(); parent::setUp();
if ($this->connection->getDriver() instanceof Driver) { if ($this->connection->getDriver() instanceof Driver) {
......
...@@ -6,16 +6,14 @@ use Doctrine\DBAL\Connection; ...@@ -6,16 +6,14 @@ use Doctrine\DBAL\Connection;
use Doctrine\DBAL\Driver as DriverInterface; use Doctrine\DBAL\Driver as DriverInterface;
use Doctrine\DBAL\Driver\SQLAnywhere\Driver; use Doctrine\DBAL\Driver\SQLAnywhere\Driver;
use Doctrine\Tests\DBAL\Functional\Driver\AbstractDriverTest; use Doctrine\Tests\DBAL\Functional\Driver\AbstractDriverTest;
use function extension_loaded;
/**
* @requires extension sqlanywhere
*/
class DriverTest extends AbstractDriverTest class DriverTest extends AbstractDriverTest
{ {
protected function setUp() : void protected function setUp() : void
{ {
if (! extension_loaded('sqlanywhere')) {
$this->markTestSkipped('sqlanywhere is not installed.');
}
parent::setUp(); parent::setUp();
if ($this->connection->getDriver() instanceof Driver) { if ($this->connection->getDriver() instanceof Driver) {
......
...@@ -5,16 +5,14 @@ namespace Doctrine\Tests\DBAL\Functional\Driver\SQLAnywhere; ...@@ -5,16 +5,14 @@ namespace Doctrine\Tests\DBAL\Functional\Driver\SQLAnywhere;
use Doctrine\DBAL\Driver\SQLAnywhere\Driver; use Doctrine\DBAL\Driver\SQLAnywhere\Driver;
use Doctrine\DBAL\DriverManager; use Doctrine\DBAL\DriverManager;
use Doctrine\Tests\DbalFunctionalTestCase; use Doctrine\Tests\DbalFunctionalTestCase;
use function extension_loaded;
/**
* @requires extension sqlanywhere
*/
class StatementTest extends DbalFunctionalTestCase class StatementTest extends DbalFunctionalTestCase
{ {
protected function setUp() : void protected function setUp() : void
{ {
if (! extension_loaded('sqlanywhere')) {
$this->markTestSkipped('sqlanywhere is not installed.');
}
parent::setUp(); parent::setUp();
if ($this->connection->getDriver() instanceof Driver) { if ($this->connection->getDriver() instanceof Driver) {
......
...@@ -5,16 +5,14 @@ namespace Doctrine\Tests\DBAL\Functional\Driver\SQLSrv; ...@@ -5,16 +5,14 @@ namespace Doctrine\Tests\DBAL\Functional\Driver\SQLSrv;
use Doctrine\DBAL\Driver as DriverInterface; use Doctrine\DBAL\Driver as DriverInterface;
use Doctrine\DBAL\Driver\SQLSrv\Driver; use Doctrine\DBAL\Driver\SQLSrv\Driver;
use Doctrine\Tests\DBAL\Functional\Driver\AbstractDriverTest; use Doctrine\Tests\DBAL\Functional\Driver\AbstractDriverTest;
use function extension_loaded;
/**
* @requires extension sqlsrv
*/
class DriverTest extends AbstractDriverTest class DriverTest extends AbstractDriverTest
{ {
protected function setUp() : void protected function setUp() : void
{ {
if (! extension_loaded('sqlsrv')) {
$this->markTestSkipped('sqlsrv is not installed.');
}
parent::setUp(); parent::setUp();
if ($this->connection->getDriver() instanceof Driver) { if ($this->connection->getDriver() instanceof Driver) {
......
...@@ -5,16 +5,14 @@ namespace Doctrine\Tests\DBAL\Functional\Driver\SQLSrv; ...@@ -5,16 +5,14 @@ namespace Doctrine\Tests\DBAL\Functional\Driver\SQLSrv;
use Doctrine\DBAL\Driver\SQLSrv\Driver; use Doctrine\DBAL\Driver\SQLSrv\Driver;
use Doctrine\DBAL\Driver\SQLSrv\SQLSrvException; use Doctrine\DBAL\Driver\SQLSrv\SQLSrvException;
use Doctrine\Tests\DbalFunctionalTestCase; use Doctrine\Tests\DbalFunctionalTestCase;
use function extension_loaded;
/**
* @requires extension sqlsrv
*/
class StatementTest extends DbalFunctionalTestCase class StatementTest extends DbalFunctionalTestCase
{ {
protected function setUp() : void protected function setUp() : void
{ {
if (! extension_loaded('sqlsrv')) {
self::markTestSkipped('sqlsrv is not installed.');
}
parent::setUp(); parent::setUp();
if ($this->connection->getDriver() instanceof Driver) { if ($this->connection->getDriver() instanceof Driver) {
......
...@@ -6,16 +6,14 @@ use Doctrine\DBAL\Driver\PDOConnection; ...@@ -6,16 +6,14 @@ use Doctrine\DBAL\Driver\PDOConnection;
use Doctrine\DBAL\Schema\Table; use Doctrine\DBAL\Schema\Table;
use Doctrine\Tests\DbalFunctionalTestCase; use Doctrine\Tests\DbalFunctionalTestCase;
use PDO; use PDO;
use function extension_loaded;
/**
* @requires extension pdo
*/
class PDOStatementTest extends DbalFunctionalTestCase class PDOStatementTest extends DbalFunctionalTestCase
{ {
protected function setUp() : void protected function setUp() : void
{ {
if (! extension_loaded('pdo')) {
$this->markTestSkipped('PDO is not installed');
}
parent::setUp(); parent::setUp();
if (! $this->connection->getWrappedConnection() instanceof PDOConnection) { if (! $this->connection->getWrappedConnection() instanceof PDOConnection) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment