]> gitweb.fluxo.info Git - semanticscuttle.git/commitdiff
use bootstrap file declared in phpunit.xml and do not include it in every single...
authorChristian Weiske <cweiske@cweiske.de>
Tue, 12 Apr 2011 07:29:59 +0000 (09:29 +0200)
committerChristian Weiske <cweiske@cweiske.de>
Tue, 12 Apr 2011 07:29:59 +0000 (09:29 +0200)
18 files changed:
tests/AllTests.php
tests/Api/ExportCsvTest.php
tests/Api/PostsAddTest.php
tests/Api/PostsDeleteTest.php
tests/Api/PostsUpdateTest.php
tests/Bookmark2TagTest.php
tests/BookmarkTest.php
tests/CommonDescriptionTest.php
tests/SearchHistoryTest.php
tests/Tag2TagTest.php
tests/TagTest.php
tests/TagsCacheTest.php
tests/UserArrayTest.php
tests/UserTest.php
tests/VoteTest.php
tests/ajax/GetAdminLinkedTagsTest.php
tests/ajax/GetAdminTagsTest.php
tests/ajax/GetContactTagsTest.php

index 4afcc6bfae7a11f2db8032585985f5bbaa17e68f..9e825e85e559712796f2f4d165195879a984edc2 100644 (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', '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
@@ -40,14 +32,6 @@ require_once 'prepare.php';
  */
 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();
@@ -74,9 +58,4 @@ class AllTests extends PHPUnit_Framework_TestSuite
     {
     }
 }
-
-if (PHPUnit_MAIN_METHOD == 'AllTests::main') {
-    AllTests::main();
-}
-
 ?>
\ No newline at end of file
index 2bff8a5eb3471f59d94bb82403f1e70ae3967931..681f0de6154923383895c3654c54632407daa791 100644 (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
  *
@@ -39,21 +33,6 @@ class Api_ExportCsvTest extends TestBaseApi
 
 
 
-    /**
-     * 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
      */
@@ -280,8 +259,4 @@ class Api_ExportCsvTest extends TestBaseApi
         return $ar;
     }
 }
-
-if (PHPUnit_MAIN_METHOD == 'Api_ExportCsvTest::main') {
-    Api_ExportCsvTest::main();
-}
 ?>
\ No newline at end of file
index 1f21d0435fd8255a7f3ebe18cf3dbe0bdaad1a7a..53aa8e7f17ebb3712181e5940da1907168a13489 100644 (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.
  *
@@ -37,21 +31,6 @@ class Api_PostsAddTest extends TestBaseApi
 
 
 
-    /**
-     * 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
      */
@@ -428,8 +407,4 @@ TXT;
         $this->assertEquals($title2, $data['bookmarks'][0]['bTitle']);
     }
 }
-
-if (PHPUnit_MAIN_METHOD == 'Api_PostsAddTest::main') {
-    Api_PostsAddTest::main();
-}
 ?>
\ No newline at end of file
index d9fb6cd4724c782f6f38f3521a4e7b3be73f8cf0..7ba1285a256c31370b151d900f7b38dd9c85fbf9 100644 (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.
  *
@@ -37,21 +31,6 @@ class Api_PostsDeleteTest extends TestBaseApi
 
 
 
-    /**
-     * 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
      */
@@ -296,8 +275,4 @@ class Api_PostsDeleteTest extends TestBaseApi
     }
 
 }
-
-if (PHPUnit_MAIN_METHOD == 'Api_PostsDeleteTest::main') {
-    Api_PostsDeleteTest::main();
-}
 ?>
\ No newline at end of file
index c497a55a49d9358c6086a9c506c8b64e247d2785..51f8be2cb8c734506c335d4044adc11c0d8f206c 100644 (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.
  *
@@ -37,21 +31,6 @@ class Api_PostsUpdateTest extends TestBaseApi
 
 
 
-    /**
-     * 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
      */
@@ -128,8 +107,4 @@ class Api_PostsUpdateTest extends TestBaseApi
     }
 
 }
-
-if (PHPUnit_MAIN_METHOD == 'Api_PostsUpdateTest::main') {
-    Api_PostsUpdateTest::main();
-}
 ?>
\ No newline at end of file
index fff4222c6ea43bf9ed56bbfe96fef5711c30aa92..789540f85910b30252ee9ae6ce1040bc5fabcedf 100644 (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.
@@ -58,21 +53,6 @@ class Bookmark2TagTest 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');
@@ -628,8 +608,4 @@ class Bookmark2TagTest extends TestBase
         $this->assertContains(array('tag' => 'usable', 'bCount' => '2'), $arTags);
     }
 }
-
-if (PHPUnit_MAIN_METHOD == 'Bookmark2TagTest::main') {
-    Bookmark2TagTest::main();
-}
 ?>
\ No newline at end of file
index f54fe9af76e3ca401b55e704eb3e551606beba49..e7ce48817143b80d21ff60e8704994a78f5712dd 100644 (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.
@@ -37,22 +32,6 @@ class BookmarkTest extends TestBase
     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');
@@ -1344,10 +1323,5 @@ class BookmarkTest extends TestBase
 
 
 
-}
-
-
-if (PHPUnit_MAIN_METHOD == 'BookmarkTest::main') {
-    BookmarkTest::main();
 }
 ?>
index 94f431d52e5ae8a502a146ed26a8ac4720cdc4c4..7748cb3fd5d3509a244ccdd69fd08048c2cfe082 100644 (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', 'CommonDescriptionTest::main');
-}
-
-require_once 'prepare.php';
 
 /**
  * Unit tests for the SemanticScuttle common description service.
@@ -39,21 +34,6 @@ class CommonDescriptionTest extends TestBase
     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');
@@ -128,9 +108,4 @@ class CommonDescriptionTest extends TestBase
     }
 
 }
-
-
-if (PHPUnit_MAIN_METHOD == 'CommonDescriptionTest::main') {
-    CommonDescriptionTest::main();
-}
 ?>
index 69d1efaa4917024e7b5a5da9ee3d964765097785..f05dd29d8cb44f5b9c1dc2229d78dd5dc98fbb19 100644 (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', 'SearchHistoryTest::main');
-}
-
-require_once 'prepare.php';
 
 /**
  * Unit tests for the SemanticScuttle search history service.
@@ -38,22 +33,6 @@ class SearchHistoryTest extends TestBase
     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
      *
@@ -391,10 +370,4 @@ class SearchHistoryTest extends TestBase
         $this->assertEquals(0, $this->shs->countSearches());
     }
 }
-
-
-if (PHPUnit_MAIN_METHOD == 'SearchHistoryTest::main') {
-    SearchHistoryTest::main();
-}
-
 ?>
index 033fc91cfe984cb794ae3759d20e4561238c8c8b..0b73864c9b1e06faf9b4c16287a99d4b23d26b1e 100644 (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', 'Tag2TagTest::main');
-}
-
-require_once 'prepare.php';
 
 /**
  * Unit tests for the SemanticScuttle tag2tag service.
@@ -37,22 +32,6 @@ class Tag2TagTest extends TestBase
     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');
@@ -550,8 +529,4 @@ class Tag2TagTest extends TestBase
 
      }*/
 }
-
-if (PHPUnit_MAIN_METHOD == 'Tag2TagTest::main') {
-    Tag2TagTest::main();
-}
 ?>
index 25d1a77cf576976d1b04eeb7d2593481e4394809..96f3f14d9c1f40ae119d56f6545eee29bbc359cd 100644 (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', 'TagTest::main');
-}
-
-require_once 'prepare.php';
 
 /**
  * Unit tests for the SemanticScuttle tag service.
@@ -34,22 +29,6 @@ class TagTest extends TestBase
     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');
@@ -109,9 +88,4 @@ class TagTest extends TestBase
     }
 
 }
-
-
-if (PHPUnit_MAIN_METHOD == 'TagTest::main') {
-    TagTest::main();
-}
 ?>
index 94200dd6d2ee233f59289e52e7facfc5d9e9b947..1f69b583f169208eac31e0524f0d3291c774b383 100644 (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', 'TagsCacheTest::main');
-}
-
-require_once 'prepare.php';
 
 /**
  * Unit tests for the SemanticScuttle tags cache service.
@@ -38,19 +33,6 @@ class TagsCacheTest extends PHPUnit_Framework_TestCase
 
 
 
-    /**
-     * 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');
@@ -207,9 +189,4 @@ class TagsCacheTest extends PHPUnit_Framework_TestCase
         $this->assertEquals(array(), $tcs->getSynonyms('d', 1));
     }
 }
-
-if (PHPUnit_MAIN_METHOD == 'TagsCacheTest::main') {
-    TagsCacheTest::main();
-}
-
 ?>
index cb53f15019a28aeaf2f8803ee8eea843d3ff2a19..a60e37f42a166f08ab0c64ce1c0abcb21525e317 100644 (file)
@@ -11,8 +11,6 @@
  * @link     http://sourceforge.net/projects/semanticscuttle
  */
 
-require_once 'prepare.php';
-
 /**
  * Unit tests for the SemanticScuttle user array model.
  *
index 49f373016e7ed6b3962408f3ac3583a83326bc58..2f5711256a674fd9396fe05dc153e134d18cac75 100644 (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', 'UserTest::main');
-}
-
-require_once 'prepare.php';
 
 /**
  * Unit tests for the SemanticScuttle user service.
@@ -31,24 +26,6 @@ require_once 'prepare.php';
  */
 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');
@@ -200,10 +177,4 @@ class UserTest extends TestBase
     }
 
 }
-
-
-if (PHPUnit_MAIN_METHOD == 'UserTest::main') {
-    UserTest::main();
-}
-
 ?>
\ No newline at end of file
index 1623826e8875e5e7786a5da415a47c4102b2f452..00736787588422d59d65b52647455120fc722b61 100644 (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.
@@ -43,21 +38,6 @@ class VoteTest 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('VoteTest')
-        );
-    }
-
-
-
     public function setUp()
     {
         $GLOBALS['enableVoting'] = true;
@@ -553,9 +533,4 @@ class VoteTest extends TestBase
     }
 
 }//class VoteTest extends TestBase
-
-
-if (PHPUnit_MAIN_METHOD == 'VoteTest::main') {
-    VoteTest::main();
-}
 ?>
\ No newline at end of file
index aded8348db023a8d8fb35dcec294048401f076a6..43cb17a350effb9028cbb020fb7d565f00b623aa 100644 (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
  *
@@ -34,22 +28,6 @@ class ajax_GetAdminLinkedTagsTest extends TestBaseApi
     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
@@ -139,8 +117,4 @@ class ajax_GetAdminLinkedTagsTest extends TestBaseApi
         $this->assertEquals('adminsubtag', $data[0]->data->title);
     }
 }
-
-if (PHPUnit_MAIN_METHOD == 'ajax_GetAdminLinkedTagsTest::main') {
-    ajax_GetAdminLinkedTagsTest::main();
-}
 ?>
\ No newline at end of file
index 80d702fb08edda028db4ddc9a0b1ca3f2c435353..8bf8a83b3bb0b2145d102b5ce7176f43d7d0b814 100644 (file)
@@ -12,8 +12,6 @@
  * @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';
 
 /**
index 559040f59ed49492a685756e060f4e6ce140c061..268ed6614f6c17bcb452e9f95bb7aa7d1af27312 100644 (file)
@@ -12,8 +12,6 @@
  * @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';
 
 /**