first test for service factory
This commit is contained in:
parent
36ff61b38e
commit
90f29d6e67
3 changed files with 23 additions and 5 deletions
|
@ -107,6 +107,7 @@ class SemanticScuttle_Service_Factory
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Loads self::$db if it is not loaded already.
|
* Loads self::$db if it is not loaded already.
|
||||||
|
* Dies if the connection could not be established.
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
|
@ -141,7 +142,7 @@ class SemanticScuttle_Service_Factory
|
||||||
/**
|
/**
|
||||||
* Returns sql database object
|
* Returns sql database object
|
||||||
*
|
*
|
||||||
* @return void
|
* @return sql_db Database instance
|
||||||
*/
|
*/
|
||||||
public static function getDb()
|
public static function getDb()
|
||||||
{
|
{
|
||||||
|
|
13
tests/FactoryTest.php
Normal file
13
tests/FactoryTest.php
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
class FactoryTest extends TestBase
|
||||||
|
{
|
||||||
|
public function testGetDb()
|
||||||
|
{
|
||||||
|
$this->assertInstanceOf(
|
||||||
|
'sql_db',
|
||||||
|
SemanticScuttle_Service_Factory::getDb()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
|
@ -1,8 +1,12 @@
|
||||||
<?xml version="1.0" encoding="utf-8" ?>
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
<phpunit>
|
<phpunit strict="true" colors="true"
|
||||||
|
bootstrap="prepare.php"
|
||||||
|
>
|
||||||
<filter>
|
<filter>
|
||||||
<blacklist>
|
<whitelist addUncoveredFilesFromWhitelist="false">
|
||||||
<directory suffix=".php">.</directory>
|
<directory suffix=".php">../src/SemanticScuttle/</directory>
|
||||||
</blacklist>
|
<directory suffix=".php">../data/templates/</directory>
|
||||||
|
<directory suffix=".php">../www/</directory>
|
||||||
|
</whitelist>
|
||||||
</filter>
|
</filter>
|
||||||
</phpunit>
|
</phpunit>
|
Loading…
Reference in a new issue