File tree Expand file tree Collapse file tree 6 files changed +47
-0
lines changed Expand file tree Collapse file tree 6 files changed +47
-0
lines changed Original file line number Diff line number Diff line change 66
77namespace Joomla \Database \Tests ;
88
9+ use Joomla \Database \Mysql \MysqlDriver ;
910use Joomla \Test \TestDatabase ;
1011use Joomla \Database \DatabaseDriver ;
1112
@@ -43,6 +44,12 @@ public static function setUpBeforeClass()
4344 return ;
4445 }
4546
47+ // Make sure the driver is supported
48+ if (!MysqlDriver::isSupported ())
49+ {
50+ static ::skip ('The PDO MySQL driver is not supported on this platform. ' );
51+ }
52+
4653 // First let's trim the mysql: part off the front of the DSN if it exists.
4754 if (strpos ($ dsn , 'mysql: ' ) === 0 )
4855 {
Original file line number Diff line number Diff line change 66
77namespace Joomla \Database \Tests ;
88
9+ use Joomla \Database \Mysql \MysqlDriver ;
10+ use Joomla \Database \Mysqli \MysqliDriver ;
911use Joomla \Test \TestDatabase ;
1012use Joomla \Database \DatabaseDriver ;
1113
@@ -43,6 +45,12 @@ public static function setUpBeforeClass()
4345 return ;
4446 }
4547
48+ // Make sure the driver is supported, we check both PDO MySQL and MySQLi here due to PHPUnit requiring a PDO connection to set up the test
49+ if (!MysqlDriver::isSupported () || !MysqliDriver::isSupported ())
50+ {
51+ static ::skip ('The PDO MySQL or MySQLi driver is not supported on this platform. ' );
52+ }
53+
4654 // First let's trim the mysql: part off the front of the DSN if it exists.
4755 if (strpos ($ dsn , 'mysql: ' ) === 0 )
4856 {
Original file line number Diff line number Diff line change 66
77namespace Joomla \Database \Tests ;
88
9+ use Joomla \Database \Oracle \OracleDriver ;
910use Joomla \Test \TestDatabase ;
1011use Joomla \Database \DatabaseDriver ;
1112
@@ -43,6 +44,12 @@ public static function setUpBeforeClass()
4344 return ;
4445 }
4546
47+ // Make sure the driver is supported
48+ if (!OracleDriver::isSupported ())
49+ {
50+ static ::skip ('The PDO Oracle driver is not supported on this platform. ' );
51+ }
52+
4653 // First let's trim the oci: part off the front of the DSN if it exists.
4754 if (strpos ($ dsn , 'oci: ' ) === 0 )
4855 {
Original file line number Diff line number Diff line change 66
77namespace Joomla \Database \Tests ;
88
9+ use Joomla \Database \Pgsql \PgsqlDriver ;
910use Joomla \Test \TestDatabase ;
1011use Joomla \Database \DatabaseDriver ;
1112
@@ -43,6 +44,12 @@ public static function setUpBeforeClass()
4344 return ;
4445 }
4546
47+ // Make sure the driver is supported
48+ if (!PgsqlDriver::isSupported ())
49+ {
50+ static ::skip ('The PDO PostgreSQL driver is not supported on this platform. ' );
51+ }
52+
4653 // First let's trim the pgsql: part off the front of the DSN if it exists.
4754 if (strpos ($ dsn , 'pgsql: ' ) === 0 )
4855 {
Original file line number Diff line number Diff line change 66
77namespace Joomla \Database \Tests ;
88
9+ use Joomla \Database \Pgsql \PgsqlDriver ;
10+ use Joomla \Database \Postgresql \PostgresqlDriver ;
911use Joomla \Test \TestDatabase ;
1012use Joomla \Database \DatabaseDriver ;
1113
@@ -43,6 +45,15 @@ public static function setUpBeforeClass()
4345 return ;
4446 }
4547
48+ /*
49+ * Make sure the driver is supported, we check both PDO PostgreSQL and "plain" PostgreSQL here
50+ * due to PHPUnit requiring a PDO connection to set up the test
51+ */
52+ if (!PostgresqlDriver::isSupported () || !PgsqlDriver::isSupported ())
53+ {
54+ static ::skip ('The PDO PostgreSQL or PostgreSQL driver is not supported on this platform. ' );
55+ }
56+
4657 // First let's trim the pgsql: part off the front of the DSN if it exists.
4758 if (strpos ($ dsn , 'pgsql: ' ) === 0 )
4859 {
Original file line number Diff line number Diff line change 66
77namespace Joomla \Database \Tests ;
88
9+ use Joomla \Database \Sqlsrv \SqlsrvDriver ;
910use Joomla \Test \TestDatabase ;
1011use Joomla \Database \DatabaseDriver ;
1112
@@ -43,6 +44,12 @@ public static function setUpBeforeClass()
4344 return ;
4445 }
4546
47+ // Make sure the driver is supported
48+ if (!SqlsrvDriver::isSupported ())
49+ {
50+ static ::skip ('The SQL Server driver is not supported on this platform. ' );
51+ }
52+
4653 // First let's trim the sqlsrv: part off the front of the DSN if it exists.
4754 if (strpos ($ dsn , 'sqlsrv: ' ) === 0 )
4855 {
You can’t perform that action at this time.
0 commit comments