commit 686f2a1eabb527ef7e2d31d4afb2893c72be06b2
parent 20d18a6ecbb801448085e0ca1563d6c38bb1e066
Author: mtrnord <mtrnord1@gmail.com>
Date: Sun, 4 Oct 2015 21:19:15 +0200
try to do it like this
Diffstat:
3 files changed, 26 insertions(+), 16 deletions(-)
diff --git a/phpunit_mysqli.xml b/phpunit_mysqli.xml
@@ -8,6 +8,11 @@
</php>
<testsuite name="mysqliLoadedTest">
<file>tests/mysqliLoadedTest.php</file>
+ </testsuite>
+ <testsuite name="mysqliMakeDB">
<file>tests/mysqliMakeDB.php</file>
</testsuite>
+ <testsuite name="mysqliConnectionTest">
+ <file>tests/mysqliConnectionTest.php</file>
+ </testsuite>
</phpunit>
diff --git a/tests/mysqliConnectionTest.php b/tests/mysqliConnectionTest.php
@@ -0,0 +1,21 @@
+<?php
+require_once ('tests/mysqliLoadedTest.php');
+class mysqliLoadedTest extends PHPUnit_Framework_TestCase
+{
+ /**
+ * @depends testForMysqli
+ */
+ public function tryDBConnection()
+ {
+ $mysqli = new mysqli("localhost","root","","RPICMS");
+ // Check connection
+ if ($mysqli->connect_errno > 0)
+ {
+ $this->markTestSkipped($mysqli->connect_error());
+ }else{
+ fwrite(STDERR, print_r('[mysqliLoadedTest]->[tryDBConnection()]: Could connect to MySQLi', TRUE));
+ }
+ return '[mysqliLoadedTest]->[tryDBConnection()]: Could connect to MySQLi';
+ }
+}
+?>
diff --git a/tests/mysqliLoadedTest.php b/tests/mysqliLoadedTest.php
@@ -11,21 +11,5 @@ class mysqliLoadedTest extends PHPUnit_Framework_TestCase
}
return '[mysqliLoadedTest]->[testForMysqli()]: The MySQLi extension is available';
}
-
- /**
- * @depends testForMysqli
- */
- public function tryDBConnection()
- {
- $mysqli = new mysqli("localhost","root","","RPICMS");
- // Check connection
- if ($mysqli->connect_errno > 0)
- {
- $this->markTestSkipped($mysqli->connect_error());
- }else{
- fwrite(STDERR, print_r('[mysqliLoadedTest]->[tryDBConnection()]: Could connect to MySQLi', TRUE));
- }
- return '[mysqliLoadedTest]->[tryDBConnection()]: Could connect to MySQLi';
- }
}
?>