]> gitweb.fluxo.info Git - semanticscuttle.git/commitdiff
allow adding of certain addresses
authorcweiske <cweiske@b3834d28-1941-0410-a4f8-b48e95affb8f>
Tue, 16 Feb 2010 21:54:31 +0000 (21:54 +0000)
committercweiske <cweiske@b3834d28-1941-0410-a4f8-b48e95affb8f>
Tue, 16 Feb 2010 21:54:31 +0000 (21:54 +0000)
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@654 b3834d28-1941-0410-a4f8-b48e95affb8f

tests/TestBase.php

index 05988a5871d2e7241d4385781acd888f540b4047..f23f678a4c47f5fddd0aeab32e8c037112ba0370 100644 (file)
@@ -29,11 +29,12 @@ class TestBase extends PHPUnit_Framework_TestCase
     /**
      * Create a new bookmark.
      *
-     * @param integer $user User ID the bookmark shall belong
+     * @param integer $user    User ID the bookmark shall belong
+     * @param string  $address Bookmark address to use
      *
      * @return integer ID of bookmark
      */
-    protected function addBookmark($user = null)
+    protected function addBookmark($user = null, $address = null)
     {
         if ($user === null) {
             $user = $this->addUser();
@@ -41,8 +42,13 @@ class TestBase extends PHPUnit_Framework_TestCase
 
         $bs   = SemanticScuttle_Service_Factory::get('Bookmark');
         $rand = rand();
+
+        if ($address === null) {
+            $address = 'http://example.org/' . $rand;
+        }
+
         $bid  = $bs->addBookmark(
-            'http://example.org/' . $rand,
+            $address,
             'unittest bookmark #' . $rand,
             'description',
             null,