* @license GPL http://www.gnu.org/licenses/gpl.html
* @link http://sourceforge.net/projects/semanticscuttle
*/
-if (!defined('PHPUnit_MAIN_METHOD')) {
- define('PHPUnit_MAIN_METHOD', 'AllTests::main');
-}
-
-require_once 'prepare.php';
/**
* SemanticScuttle unit tests.
*
* To launch this tests, you need PHPUnit 3.
* Run them with:
- * $ php tests/AllTests.php
+ * $ cd tests; phpunit .
* or single files like:
- * $ php tests/BookmarkTest.php
- *
- * You also may use phpunit directly:
- * $ phpunit tests/AllTests.php
+ * $ cd tests; phpunit BookmarkTest.php
*
* @category Bookmarking
* @package SemanticScuttle
*/
class AllTests extends PHPUnit_Framework_TestSuite
{
- public static function main()
- {
- require_once 'PHPUnit/TextUI/TestRunner.php';
- PHPUnit_TextUI_TestRunner::run(self::suite());
- }
-
-
-
public static function suite()
{
$suite = new AllTests();
{
}
}
-
-if (PHPUnit_MAIN_METHOD == 'AllTests::main') {
- AllTests::main();
-}
-
?>
\ No newline at end of file
* @license GPL http://www.gnu.org/licenses/gpl.html
* @link http://sourceforge.net/projects/semanticscuttle
*/
-
-require_once dirname(__FILE__) . '/../prepare.php';
require_once 'HTTP/Request2.php';
-if (!defined('PHPUnit_MAIN_METHOD')) {
- define('PHPUnit_MAIN_METHOD', 'Api_ExportCsvTest::main');
-}
-
/**
* Unit tests for the SemanticScuttle csv export API
*
- /**
- * 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__)
- );
- }
-
-
-
/**
* Test if authentication is required when sending no auth data
*/
return $ar;
}
}
-
-if (PHPUnit_MAIN_METHOD == 'Api_ExportCsvTest::main') {
- Api_ExportCsvTest::main();
-}
?>
\ No newline at end of file
* @license GPL http://www.gnu.org/licenses/gpl.html
* @link http://sourceforge.net/projects/semanticscuttle
*/
-
-require_once dirname(__FILE__) . '/../prepare.php';
require_once 'HTTP/Request2.php';
-if (!defined('PHPUnit_MAIN_METHOD')) {
- define('PHPUnit_MAIN_METHOD', 'Api_PostsAddTest::main');
-}
-
/**
* Unit tests for the SemanticScuttle post addition API.
*
- /**
- * 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__)
- );
- }
-
-
-
/**
* Test if authentication is required when sending no auth data
*/
$this->assertEquals($title2, $data['bookmarks'][0]['bTitle']);
}
}
-
-if (PHPUnit_MAIN_METHOD == 'Api_PostsAddTest::main') {
- Api_PostsAddTest::main();
-}
?>
\ No newline at end of file
* @license GPL http://www.gnu.org/licenses/gpl.html
* @link http://sourceforge.net/projects/semanticscuttle
*/
-
-require_once dirname(__FILE__) . '/../prepare.php';
require_once 'HTTP/Request2.php';
-if (!defined('PHPUnit_MAIN_METHOD')) {
- define('PHPUnit_MAIN_METHOD', 'Api_PostsDeleteTest::main');
-}
-
/**
* Unit tests for the SemanticScuttle post deletion API.
*
- /**
- * 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__)
- );
- }
-
-
-
/**
* Test if authentication is required when sending no auth data
*/
}
}
-
-if (PHPUnit_MAIN_METHOD == 'Api_PostsDeleteTest::main') {
- Api_PostsDeleteTest::main();
-}
?>
\ No newline at end of file
* @license GPL http://www.gnu.org/licenses/gpl.html
* @link http://sourceforge.net/projects/semanticscuttle
*/
-
-require_once dirname(__FILE__) . '/../prepare.php';
require_once 'HTTP/Request2.php';
-if (!defined('PHPUnit_MAIN_METHOD')) {
- define('PHPUnit_MAIN_METHOD', 'Api_PostsUpdateTest::main');
-}
-
/**
* Unit tests for the SemanticScuttle last-update time API.
*
- /**
- * 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__)
- );
- }
-
-
-
/**
* Test if authentication is required when sending no auth data
*/
}
}
-
-if (PHPUnit_MAIN_METHOD == 'Api_PostsUpdateTest::main') {
- Api_PostsUpdateTest::main();
-}
?>
\ No newline at end of file
* @license GPL http://www.gnu.org/licenses/gpl.html
* @link http://sourceforge.net/projects/semanticscuttle
*/
-if (!defined('PHPUnit_MAIN_METHOD')) {
- define('PHPUnit_MAIN_METHOD', 'Bookmark2TagTest::main');
-}
-
-require_once 'prepare.php';
/**
* Unit tests for the SemanticScuttle bookmark-tag combination service.
- /**
- * 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()
{
$this->us = SemanticScuttle_Service_Factory::get('User');
$this->assertContains(array('tag' => 'usable', 'bCount' => '2'), $arTags);
}
}
-
-if (PHPUnit_MAIN_METHOD == 'Bookmark2TagTest::main') {
- Bookmark2TagTest::main();
-}
?>
\ No newline at end of file
* @license GPL http://www.gnu.org/licenses/gpl.html
* @link http://sourceforge.net/projects/semanticscuttle
*/
-if (!defined('PHPUnit_MAIN_METHOD')) {
- define('PHPUnit_MAIN_METHOD', 'BookmarkTest::main');
-}
-
-require_once 'prepare.php';
/**
* Unit tests for the SemanticScuttle bookmark service.
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()
{
$this->us = SemanticScuttle_Service_Factory::get('User');
-}
-
-
-if (PHPUnit_MAIN_METHOD == 'BookmarkTest::main') {
- BookmarkTest::main();
}
?>
* @license GPL http://www.gnu.org/licenses/gpl.html
* @link http://sourceforge.net/projects/semanticscuttle
*/
-if (!defined('PHPUnit_MAIN_METHOD')) {
- define('PHPUnit_MAIN_METHOD', 'CommonDescriptionTest::main');
-}
-
-require_once 'prepare.php';
/**
* Unit tests for the SemanticScuttle common description service.
protected $cds;
-
- /**
- * 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()
{
$this->us =SemanticScuttle_Service_Factory::get('User');
}
}
-
-
-if (PHPUnit_MAIN_METHOD == 'CommonDescriptionTest::main') {
- CommonDescriptionTest::main();
-}
?>
* @license GPL http://www.gnu.org/licenses/gpl.html
* @link http://sourceforge.net/projects/semanticscuttle
*/
-if (!defined('PHPUnit_MAIN_METHOD')) {
- define('PHPUnit_MAIN_METHOD', 'SearchHistoryTest::main');
-}
-
-require_once 'prepare.php';
/**
* Unit tests for the SemanticScuttle search history service.
protected $shs;
-
- /**
- * 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__)
- );
- }
-
-
-
/**
* Set up all services
*
$this->assertEquals(0, $this->shs->countSearches());
}
}
-
-
-if (PHPUnit_MAIN_METHOD == 'SearchHistoryTest::main') {
- SearchHistoryTest::main();
-}
-
?>
* @license GPL http://www.gnu.org/licenses/gpl.html
* @link http://sourceforge.net/projects/semanticscuttle
*/
-if (!defined('PHPUnit_MAIN_METHOD')) {
- define('PHPUnit_MAIN_METHOD', 'Tag2TagTest::main');
-}
-
-require_once 'prepare.php';
/**
* Unit tests for the SemanticScuttle tag2tag service.
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()
{
$this->us =SemanticScuttle_Service_Factory::get('User');
}*/
}
-
-if (PHPUnit_MAIN_METHOD == 'Tag2TagTest::main') {
- Tag2TagTest::main();
-}
?>
* @license GPL http://www.gnu.org/licenses/gpl.html
* @link http://sourceforge.net/projects/semanticscuttle
*/
-if (!defined('PHPUnit_MAIN_METHOD')) {
- define('PHPUnit_MAIN_METHOD', 'TagTest::main');
-}
-
-require_once 'prepare.php';
/**
* Unit tests for the SemanticScuttle tag service.
protected $ts;
-
- /**
- * 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()
{
$this->ts =SemanticScuttle_Service_Factory::get('Tag');
}
}
-
-
-if (PHPUnit_MAIN_METHOD == 'TagTest::main') {
- TagTest::main();
-}
?>
* @license GPL http://www.gnu.org/licenses/gpl.html
* @link http://sourceforge.net/projects/semanticscuttle
*/
-if (!defined('PHPUnit_MAIN_METHOD')) {
- define('PHPUnit_MAIN_METHOD', 'TagsCacheTest::main');
-}
-
-require_once 'prepare.php';
/**
* Unit tests for the SemanticScuttle tags cache service.
- /**
- * 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()
{
$this->us =SemanticScuttle_Service_Factory::get('User');
$this->assertEquals(array(), $tcs->getSynonyms('d', 1));
}
}
-
-if (PHPUnit_MAIN_METHOD == 'TagsCacheTest::main') {
- TagsCacheTest::main();
-}
-
?>
* @link http://sourceforge.net/projects/semanticscuttle
*/
-require_once 'prepare.php';
-
/**
* Unit tests for the SemanticScuttle user array model.
*
* @license GPL http://www.gnu.org/licenses/gpl.html
* @link http://sourceforge.net/projects/semanticscuttle
*/
-if (!defined('PHPUnit_MAIN_METHOD')) {
- define('PHPUnit_MAIN_METHOD', 'UserTest::main');
-}
-
-require_once 'prepare.php';
/**
* Unit tests for the SemanticScuttle user service.
*/
class UserTest extends TestBase
{
-
-
-
- /**
- * 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()
{
$this->us = SemanticScuttle_Service_Factory::get('User');
}
}
-
-
-if (PHPUnit_MAIN_METHOD == 'UserTest::main') {
- UserTest::main();
-}
-
?>
\ No newline at end of file
* @license GPL http://www.gnu.org/licenses/gpl.html
* @link http://sourceforge.net/projects/semanticscuttle
*/
-if (!defined('PHPUnit_MAIN_METHOD')) {
- define('PHPUnit_MAIN_METHOD', 'VoteTest::main');
-}
-
-require_once 'prepare.php';
/**
* Unit tests for the SemanticScuttle voting system.
- /**
- * 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('VoteTest')
- );
- }
-
-
-
public function setUp()
{
$GLOBALS['enableVoting'] = true;
}
}//class VoteTest extends TestBase
-
-
-if (PHPUnit_MAIN_METHOD == 'VoteTest::main') {
- VoteTest::main();
-}
?>
\ No newline at end of file
* @license GPL http://www.gnu.org/licenses/gpl.html
* @link http://sourceforge.net/projects/semanticscuttle
*/
-
-require_once dirname(__FILE__) . '/../prepare.php';
require_once 'HTTP/Request2.php';
-if (!defined('PHPUnit_MAIN_METHOD')) {
- define('PHPUnit_MAIN_METHOD', 'ajax_GetAdminLinkedTagsTest::main');
-}
-
/**
* Unit tests for the ajax linked admin tags script
*
protected $urlPart = 'ajax/getadminlinkedtags.php';
-
- /**
- * 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__)
- );
- }
-
-
-
/**
* Verify that we get the configured root tags if
* we do not pass any parameters
$this->assertEquals('adminsubtag', $data[0]->data->title);
}
}
-
-if (PHPUnit_MAIN_METHOD == 'ajax_GetAdminLinkedTagsTest::main') {
- ajax_GetAdminLinkedTagsTest::main();
-}
?>
\ No newline at end of file
* @license GPL http://www.gnu.org/licenses/gpl.html
* @link http://sourceforge.net/projects/semanticscuttle
*/
-
-require_once dirname(__FILE__) . '/../prepare.php';
require_once 'HTTP/Request2.php';
/**
* @license GPL http://www.gnu.org/licenses/gpl.html
* @link http://sourceforge.net/projects/semanticscuttle
*/
-
-require_once dirname(__FILE__) . '/../prepare.php';
require_once 'HTTP/Request2.php';
/**