]> gitweb.fluxo.info Git - semanticscuttle.git/commitdiff
unification test was unstable, too
authorcweiske <cweiske@b3834d28-1941-0410-a4f8-b48e95affb8f>
Wed, 28 Oct 2009 22:33:36 +0000 (22:33 +0000)
committercweiske <cweiske@b3834d28-1941-0410-a4f8-b48e95affb8f>
Wed, 28 Oct 2009 22:33:36 +0000 (22:33 +0000)
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@464 b3834d28-1941-0410-a4f8-b48e95affb8f

src/SemanticScuttle/Service/Bookmark.php
tests/BookmarkTest.php

index e569ade07177d484b7f3266533e56e8903cbd7db..287994df69ddbcf6e189df1feb4b4e93bb823fbb 100644 (file)
@@ -479,7 +479,8 @@ class SemanticScuttle_Service_Bookmark extends SemanticScuttle_DbService
      * @param string  $sortOrder One of the following values:
      *                           "date_asc", "date_desc",
      *                           "title_desc", "title_asc",
-     *                           "url_desc", "url_asc"
+     *                           "url_desc", "url_asc",
+     *                           "voting_asc", "voting_desc"
      * @param boolean $watched   True if only watched bookmarks
      *                           shall be returned (FIXME)
      * @param integer $startdate Filter for creation date.
@@ -574,23 +575,29 @@ class SemanticScuttle_Service_Bookmark extends SemanticScuttle_DbService
         }
 
         switch($sortOrder) {
-            case 'date_asc':
-                $query_5.= ' ORDER BY B.bModified ASC ';
-                break;
-            case 'title_desc':
-                $query_5.= ' ORDER BY B.bTitle DESC ';
-                break;
-            case 'title_asc':
-                $query_5.= ' ORDER BY B.bTitle ASC ';
-                break;
-            case 'url_desc':
-                $query_5.= ' ORDER BY B.bAddress DESC ';
-                break;
-            case 'url_asc':
-                $query_5.= ' ORDER BY B.bAddress ASC ';
-                break;
-            default:
-                $query_5.= ' ORDER BY B.bModified DESC ';
+        case 'date_asc':
+            $query_5 .= ' ORDER BY B.bModified ASC ';
+            break;
+        case 'title_desc':
+            $query_5 .= ' ORDER BY B.bTitle DESC ';
+            break;
+        case 'title_asc':
+            $query_5 .= ' ORDER BY B.bTitle ASC ';
+            break;
+        case 'voting_desc':
+            $query_5 .= ' ORDER BY B.bVoting DESC ';
+            break;
+        case 'voting_asc':
+            $query_5 .= ' ORDER BY B.bVoting ASC ';
+            break;
+        case 'url_desc':
+            $query_5 .= ' ORDER BY B.bAddress DESC ';
+            break;
+        case 'url_asc':
+            $query_5 .= ' ORDER BY B.bAddress ASC ';
+            break;
+        default:
+            $query_5 .= ' ORDER BY B.bModified DESC ';
         }
 
         // Handle the parts of the query that depend on any tags that are present.
index 82c5fa647e4f6f2509250e0a9721c49388a05cce..01e6b3895b43a647e748b4cabe24f46c5f0d1454 100644 (file)
@@ -103,15 +103,18 @@ class BookmarkTest extends TestBase
     {
         $bs = $this->bs;
 
+        $uid  = $this->addUser();
+        $uid2 = $this->addUser();
+
         $bs->addBookmark(
             'http://site1.com', "title", "description", 'note',
             0, array('tag1'), null, false, false,
-            1
+            $uid
         );
         $bs->addBookmark(
             "http://site1.com", "title2", "description2", 'note',
             0, array('tag2'), null, false, false,
-            2
+            $uid2
         );
 
         $bookmarks = $bs->getBookmarks();