first test for service factory

This commit is contained in:
Christian Weiske 2011-04-12 08:47:44 +02:00
parent 36ff61b38e
commit 90f29d6e67
3 changed files with 23 additions and 5 deletions

View 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()
{

13
tests/FactoryTest.php Normal file
View file

@ -0,0 +1,13 @@
<?php
class FactoryTest extends TestBase
{
public function testGetDb()
{
$this->assertInstanceOf(
'sql_db',
SemanticScuttle_Service_Factory::getDb()
);
}
}
?>

View 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>