aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Weiske <cweiske@cweiske.de>2011-04-12 08:47:44 +0200
committerChristian Weiske <cweiske@cweiske.de>2011-04-12 08:47:44 +0200
commit90f29d6e671f4c24f75bdc4774f223c53bf0a46c (patch)
tree7ff98ab6c32af0846cbf1e1d103f2e755f1c7846
parent36ff61b38e2f374c03543b70cce487415b793073 (diff)
downloadsemanticscuttle-90f29d6e671f4c24f75bdc4774f223c53bf0a46c.tar.gz
semanticscuttle-90f29d6e671f4c24f75bdc4774f223c53bf0a46c.tar.bz2
first test for service factory
-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