]> gitweb.fluxo.info Git - semanticscuttle.git/commitdiff
first test for service factory
authorChristian Weiske <cweiske@cweiske.de>
Tue, 12 Apr 2011 06:47:44 +0000 (08:47 +0200)
committerChristian Weiske <cweiske@cweiske.de>
Tue, 12 Apr 2011 06:47:44 +0000 (08:47 +0200)
src/SemanticScuttle/Service/Factory.php
tests/FactoryTest.php [new file with mode: 0644]
tests/phpunit.xml

index d7ff1d4da873f8ff68fc9f630f2f953d480a55be..b661cdbc61fe7b443836e67551627a67a866b10f 100644 (file)
@@ -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 (file)
index 0000000..980e92e
--- /dev/null
@@ -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
index 734fa95da46e089337a8084c9f954ff98ab189f7..86b7b60a2404a17681e28a9f6d2f0649ef5099fc 100644 (file)
@@ -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