summaryrefslogtreecommitdiff
path: root/tests/Tag2TagTest.php
diff options
context:
space:
mode:
authorcweiske <cweiske@b3834d28-1941-0410-a4f8-b48e95affb8f>2009-10-25 15:31:31 +0000
committercweiske <cweiske@b3834d28-1941-0410-a4f8-b48e95affb8f>2009-10-25 15:31:31 +0000
commit05defe72d8739c0642c506175c0ad4de2293fb99 (patch)
treed160853768776e399c95d3cf83ca3fbf24481325 /tests/Tag2TagTest.php
parent9a0aefc28bba04f674d901c6ffd6a9e63628feef (diff)
downloadsemanticscuttle-05defe72d8739c0642c506175c0ad4de2293fb99.tar.gz
semanticscuttle-05defe72d8739c0642c506175c0ad4de2293fb99.tar.bz2
introduce testbase class and make all tests runnable standalone
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@410 b3834d28-1941-0410-a4f8-b48e95affb8f
Diffstat (limited to 'tests/Tag2TagTest.php')
-rw-r--r--tests/Tag2TagTest.php57
1 files changed, 47 insertions, 10 deletions
diff --git a/tests/Tag2TagTest.php b/tests/Tag2TagTest.php
index 8b23040..8a19823 100644
--- a/tests/Tag2TagTest.php
+++ b/tests/Tag2TagTest.php
@@ -1,24 +1,57 @@
<?php
-require_once 'PHPUnit/Framework.php';
-
-/*
- To launch this test, type the following line into a shell
- at the root of the scuttlePlus directory :
- phpunit Tag2TagTest tests/tag2TagTest.php
+/**
+ * SemanticScuttle - your social bookmark manager.
+ *
+ * PHP version 5.
+ *
+ * @category Bookmarking
+ * @package SemanticScuttle
+ * @author Christian Weiske <cweiske@cweiske.de>
+ * @license GPL http://www.gnu.org/licenses/gpl.html
+ * @link http://sourceforge.net/projects/semanticscuttle
*/
-class Tag2TagTest extends PHPUnit_Framework_TestCase
+require_once 'prepare.php';
+
+if (!defined('PHPUnit_MAIN_METHOD')) {
+ define('PHPUnit_MAIN_METHOD', 'Tag2TagTest::main');
+}
+
+/**
+ * Unit tests for the SemanticScuttle tag2tag service.
+ *
+ * @category Bookmarking
+ * @package SemanticScuttle
+ * @author Christian Weiske <cweiske@cweiske.de>
+ * @license GPL http://www.gnu.org/licenses/gpl.html
+ * @link http://sourceforge.net/projects/semanticscuttle
+ */
+class Tag2TagTest extends TestBase
{
protected $us;
protected $bs;
protected $b2ts;
protected $tts;
+
+
+ /**
+ * Used to run this test class standalone
+ *
+ * @return void
+ */
+ public static function main()
+ {
+ require_once 'PHPUnit/TextUI/TestRunner.php';
+ PHPUnit_TextUI_TestRunner::run(
+ new PHPUnit_Framework_TestSuite(__CLASS__)
+ );
+ }
+
+
+
protected function setUp()
{
- global $dbhost, $dbuser, $dbpass, $dbname, $dbport, $dbpersist, $dbtype, $tableprefix;
- require_once dirname(__FILE__) . '/../src/SemanticScuttle/header.php';
-
$this->us =SemanticScuttle_Service_Factory::get('User');
$this->bs =SemanticScuttle_Service_Factory::get('Bookmark');
$this->bs->deleteAll();
@@ -482,4 +515,8 @@ class Tag2TagTest extends PHPUnit_Framework_TestCase
}*/
}
+
+if (PHPUnit_MAIN_METHOD == 'Tag2TagTest::main') {
+ Tag2TagTest::main();
+}
?>