File tree Expand file tree Collapse file tree 6 files changed +30
-6
lines changed Expand file tree Collapse file tree 6 files changed +30
-6
lines changed Original file line number Diff line number Diff line change @@ -30,6 +30,9 @@ protected function setUp()
3030 */ 
3131 static  public  function  createTestEntityManager ($ pathsarray ())
3232 {
33+  if  (!class_exists ('PDO ' ) || !in_array ('sqlite ' , \PDO ::getAvailableDrivers ())) {
34+  self ::markTestSkipped ('This test requires SQLite support in your environment ' );
35+  }
3336 $ confignew  \Doctrine \ORM \Configuration ();
3437 $ configsetAutoGenerateProxyClasses (true );
3538 $ configsetProxyDir (\sys_get_temp_dir ());
Original file line number Diff line number Diff line change @@ -21,6 +21,10 @@ class ProfilerTest extends \PHPUnit_Framework_TestCase
2121{
2222 public  function  testCollect ()
2323 {
24+  if  (!class_exists ('SQLite3 ' ) && (!class_exists ('PDO ' ) || !in_array ('sqlite ' , \PDO ::getAvailableDrivers ()))) {
25+  $ this markTestSkipped ('This test requires SQLite support in your environment ' );
26+  }
27+ 
2428 $ requestnew  Request ();
2529 $ requestquery ->set ('foo ' , 'bar ' );
2630 $ responsenew  Response ();
Original file line number Diff line number Diff line change @@ -35,6 +35,9 @@ public static function tearDownAfterClass()
3535
3636 protected  function  setUp ()
3737 {
38+  if  (!class_exists ('SQLite3 ' ) && (!class_exists ('PDO ' ) || !in_array ('sqlite ' , \PDO ::getAvailableDrivers ()))) {
39+  $ this markTestSkipped ('This test requires SQLite support in your environment ' );
40+  }
3841 self ::$ storagepurge ();
3942 }
4043
Original file line number Diff line number Diff line change 2222 */ 
2323class  AclProviderBenchmarkTest extends  \PHPUnit_Framework_TestCase
2424{
25+  /** @var \Doctrine\DBAL\Connection */ 
2526 protected  $ con
2627 protected  $ insertClassStmt
2728 protected  $ insertSidStmt
@@ -31,12 +32,17 @@ class AclProviderBenchmarkTest extends \PHPUnit_Framework_TestCase
3132
3233 protected  function  setUp ()
3334 {
34-  $ this con  = DriverManager::getConnection (array (
35-  'driver '  => 'pdo_mysql ' ,
36-  'host '  => 'localhost ' ,
37-  'user '  => 'root ' ,
38-  'dbname '  => 'testdb ' ,
39-  ));
35+  try  {
36+  $ this con  = DriverManager::getConnection (array (
37+  'driver '  => 'pdo_mysql ' ,
38+  'host '  => 'localhost ' ,
39+  'user '  => 'root ' ,
40+  'dbname '  => 'testdb ' ,
41+  ));
42+  $ this con ->connect ();
43+  } catch  (\Exception   $ e
44+  $ this markTestSkipped ('Unable to connect to the database:  ' .$ egetMessage ());
45+  }
4046 }
4147
4248 protected  function  tearDown ()
Original file line number Diff line number Diff line change @@ -127,6 +127,10 @@ protected function setUp()
127127 if  (!class_exists ('Doctrine\DBAL\DriverManager ' )) {
128128 $ this markTestSkipped ('The Doctrine2 DBAL is required for this test ' );
129129 }
130+  if  (!class_exists ('PDO ' ) || !in_array ('sqlite ' , \PDO ::getAvailableDrivers ())) {
131+  self ::markTestSkipped ('This test requires SQLite support in your environment ' );
132+  }
133+ 
130134 $ this con  = DriverManager::getConnection (array (
131135 'driver '  => 'pdo_sqlite ' ,
132136 'memory '  => true ,
Original file line number Diff line number Diff line change @@ -432,6 +432,10 @@ protected function setUp()
432432 if  (!class_exists ('Doctrine\DBAL\DriverManager ' )) {
433433 $ this markTestSkipped ('The Doctrine2 DBAL is required for this test ' );
434434 }
435+  if  (!class_exists ('PDO ' ) || !in_array ('sqlite ' , \PDO ::getAvailableDrivers ())) {
436+  self ::markTestSkipped ('This test requires SQLite support in your environment ' );
437+  }
438+ 
435439 $ this con  = DriverManager::getConnection (array (
436440 'driver '  => 'pdo_sqlite ' ,
437441 'memory '  => true ,
                         You can’t perform that action at this time. 
           
                  
0 commit comments