diff options
author | Christian Weiske <cweiske@cweiske.de> | 2011-05-12 19:25:03 +0200 |
---|---|---|
committer | Christian Weiske <cweiske@cweiske.de> | 2011-05-12 19:25:03 +0200 |
commit | 88d7b9631b444cef28115fb8e0bae736b45e557e (patch) | |
tree | 9c676c98dbface055c68df2731f3a7482dae465b /tests/Model/BookmarkTest.php | |
parent | fc093a5fe51d35a2991e549e8836cac15dc2888b (diff) | |
parent | b57c8d4581b05cd70a363cacd37f9ffc7da785d8 (diff) | |
download | semanticscuttle-88d7b9631b444cef28115fb8e0bae736b45e557e.tar.gz semanticscuttle-88d7b9631b444cef28115fb8e0bae736b45e557e.tar.bz2 |
Merge branch 'master' into configurable-privacy2
Diffstat (limited to 'tests/Model/BookmarkTest.php')
-rw-r--r-- | tests/Model/BookmarkTest.php | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/tests/Model/BookmarkTest.php b/tests/Model/BookmarkTest.php new file mode 100644 index 0000000..9f55143 --- /dev/null +++ b/tests/Model/BookmarkTest.php @@ -0,0 +1,65 @@ +<?php +/** + * SemanticScuttle - your social bookmark manager. + * + * PHP version 5. + * + * @category Bookmarking + * @package SemanticScuttle + * @author Christian Weiske <cweiske@cweiske.de> + * @license GPL http://www.gnu.org/licenses/gpl.html + * @link http://sourceforge.net/projects/semanticscuttle + */ + +/** + * Unit tests for the SemanticScuttle Bookmark model + * + * @category Bookmarking + * @package SemanticScuttle + * @author Christian Weiske <cweiske@cweiske.de> + * @license GPL http://www.gnu.org/licenses/gpl.html + * @link http://sourceforge.net/projects/semanticscuttle + */ +class Model_BookmarkTest extends TestBase +{ + public function testIsValidUrlValid() + { + $this->assertTrue( + SemanticScuttle_Model_Bookmark::isValidUrl( + 'http://example.org/foo/bar?baz=foorina' + ) + ); + $this->assertTrue( + SemanticScuttle_Model_Bookmark::isValidUrl( + 'https://example.org/' + ) + ); + $this->assertTrue( + SemanticScuttle_Model_Bookmark::isValidUrl( + 'ftp://user:pass@example.org/' + ) + ); + $this->assertTrue( + SemanticScuttle_Model_Bookmark::isValidUrl( + 'mailto:cweiske@example.org' + ) + ); + } + + public function testIsValidUrlInvalid() + { + $this->assertFalse( + SemanticScuttle_Model_Bookmark::isValidUrl( + 'javascript:alert("foo")' + ) + ); + $this->assertFalse( + SemanticScuttle_Model_Bookmark::isValidUrl( + 'foo://example.org/foo/bar' + ) + ); + } + +} + +?>
\ No newline at end of file |