commit 9c23f3dca1d17a51bdeabfae824a94175f051181
parent 686f2a1eabb527ef7e2d31d4afb2893c72be06b2
Author: mtrnord <mtrnord1@gmail.com>
Date: Sun, 4 Oct 2015 21:20:58 +0200
must the function have "Test" in the name?
Diffstat:
3 files changed, 17 insertions(+), 27 deletions(-)
diff --git a/phpunit_mysqli.xml b/phpunit_mysqli.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
-<phpunit colors="true" verbose="true">
+<phpunit bootstrap="tests/bootstrap.php" colors="true" verbose="true">
<php>
<var name="db_dsn" value="mysqli:dbname=RPICMS;host=localhost"/>
<var name="db_username" value="root"/>
@@ -8,11 +8,6 @@
</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
@@ -1,21 +0,0 @@
-<?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,5 +11,21 @@ class mysqliLoadedTest extends PHPUnit_Framework_TestCase
}
return '[mysqliLoadedTest]->[testForMysqli()]: The MySQLi extension is available';
}
+
+ /**
+ * @depends testForMysqli
+ */
+ public function DBConnectionTest()
+ {
+ $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';
+ }
}
?>