aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/SemanticScuttle/Service/Factory.php3
-rw-r--r--tests/FactoryTest.php13
-rw-r--r--tests/phpunit.xml12
3 files changed, 23 insertions, 5 deletions
diff --git a/src/SemanticScuttle/Service/Factory.php b/src/SemanticScuttle/Service/Factory.php
index d7ff1d4..b661cdb 100644
--- a/src/SemanticScuttle/Service/Factory.php
+++ b/src/SemanticScuttle/Service/Factory.php
@@ -107,6 +107,7 @@ class SemanticScuttle_Service_Factory
/**
* Loads self::$db if it is not loaded already.
+ * Dies if the connection could not be established.
*
* @return void
*/
@@ -141,7 +142,7 @@ class SemanticScuttle_Service_Factory
/**
* Returns sql database object
*
- * @return void
+ * @return sql_db Database instance
*/
public static function getDb()
{
diff --git a/tests/FactoryTest.php b/tests/FactoryTest.php
new file mode 100644
index 0000000..980e92e
--- /dev/null
+++ b/tests/FactoryTest.php
@@ -0,0 +1,13 @@
+<?php
+
+class FactoryTest extends TestBase
+{
+ public function testGetDb()
+ {
+ $this->assertInstanceOf(
+ 'sql_db',
+ SemanticScuttle_Service_Factory::getDb()
+ );
+ }
+}
+?> \ No newline at end of file
diff --git a/tests/phpunit.xml b/tests/phpunit.xml
index 734fa95..86b7b60 100644
--- a/tests/phpunit.xml
+++ b/tests/phpunit.xml
@@ -1,8 +1,12 @@
<?xml version="1.0" encoding="utf-8" ?>
-<phpunit>
+<phpunit strict="true" colors="true"
+ bootstrap="prepare.php"
+>
<filter>
- <blacklist>
- <directory suffix=".php">.</directory>
- </blacklist>
+ <whitelist addUncoveredFilesFromWhitelist="false">
+ <directory suffix=".php">../src/SemanticScuttle/</directory>
+ <directory suffix=".php">../data/templates/</directory>
+ <directory suffix=".php">../www/</directory>
+ </whitelist>
</filter>
</phpunit> \ No newline at end of file