diff options
author | cweiske <cweiske@b3834d28-1941-0410-a4f8-b48e95affb8f> | 2010-03-17 20:05:43 +0000 |
---|---|---|
committer | cweiske <cweiske@b3834d28-1941-0410-a4f8-b48e95affb8f> | 2010-03-17 20:05:43 +0000 |
commit | f9e0714350cbb8efdfeac632fe2211c6c59bdbae (patch) | |
tree | 9f38b88f28d2b116f59ad28ac138a7caadf3157a | |
parent | e0dff57cbb4d2093ef58b3da7654d1305beb043f (diff) | |
download | semanticscuttle-f9e0714350cbb8efdfeac632fe2211c6c59bdbae.tar.gz semanticscuttle-f9e0714350cbb8efdfeac632fe2211c6c59bdbae.tar.bz2 |
write failing test for bug #2953732
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@687 b3834d28-1941-0410-a4f8-b48e95affb8f
-rw-r--r-- | tests/BookmarkTest.php | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/tests/BookmarkTest.php b/tests/BookmarkTest.php index 74685c4..7885876 100644 --- a/tests/BookmarkTest.php +++ b/tests/BookmarkTest.php @@ -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( |