]> gitweb.fluxo.info Git - semanticscuttle.git/commitdiff
write failing test for bug #2953732
authorcweiske <cweiske@b3834d28-1941-0410-a4f8-b48e95affb8f>
Wed, 17 Mar 2010 20:05:43 +0000 (20:05 +0000)
committercweiske <cweiske@b3834d28-1941-0410-a4f8-b48e95affb8f>
Wed, 17 Mar 2010 20:05:43 +0000 (20:05 +0000)
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@687 b3834d28-1941-0410-a4f8-b48e95affb8f

tests/BookmarkTest.php

index 74685c42b0feb917a6b094e90db5217025606bb5..7885876400af8268d40cbbe4f954b7efa0fb5cb8 100644 (file)
@@ -859,6 +859,50 @@ class BookmarkTest extends TestBase
 
 
 
+    /**
+     * Tests if getBookmarkByAddress() works correctly.
+     *
+     * @return void
+     */
+    public function testGetBookmarkByAddress()
+    {
+        $url = 'http://example.org';
+        $uid = $this->addUser();
+        $bid = $this->addBookmark($uid, $url);
+
+        $bm = $this->bs->getBookmarkByAddress($url);
+        $this->assertType('array', $bm);
+        $this->assertEquals($url, $bm['bAddress']);
+    }
+
+
+
+    /**
+     * Tests if getBookmarkByAddress() works correctly with aliases.
+     * When passing an incomplete address i.e. without protocol,
+     * the full URL needs to be searched for.
+     *
+     * The failure of this test lead to #2953732.
+     *
+     * @return void
+     *
+     * @link https://sourceforge.net/tracker/?func=detail&atid=1017430&aid=2953732&group_id=211356
+     */
+    public function testGetBookmarkByAddressAlias()
+    {
+        $url = 'http://example.org';
+        $incomplete = 'example.org';
+
+        $uid = $this->addUser();
+        $bid = $this->addBookmark($uid, $url);
+
+        $bm = $this->bs->getBookmarkByAddress($incomplete);
+        $this->assertType('array', $bm);
+        $this->assertEquals($url, $bm['bAddress']);
+    }
+
+
+
     public function testNormalize()
     {
         $this->assertEquals(