summaryrefslogtreecommitdiff
path: root/_test
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2013-06-16 12:36:58 -0700
committerAndreas Gohr <andi@splitbrain.org>2013-06-16 12:36:58 -0700
commit06f8cfbed961eb9394fa29558dd29c79f87fc9ad (patch)
tree20b02ae07d943248a0a01191409cd02120e5fcb3 /_test
parentd6b7a2dd189b692f9a754f4f1a330abe6449669a (diff)
parentb9ee6a44e7499b5c2e9f117096cedc769ef2e25d (diff)
downloadrpg-06f8cfbed961eb9394fa29558dd29c79f87fc9ad.tar.gz
rpg-06f8cfbed961eb9394fa29558dd29c79f87fc9ad.tar.bz2
Merge pull request #225 from splitbrain/fetchftp
Add media_isexternal
Diffstat (limited to '_test')
-rw-r--r--_test/tests/inc/media_isexternal.test.php22
1 files changed, 22 insertions, 0 deletions
diff --git a/_test/tests/inc/media_isexternal.test.php b/_test/tests/inc/media_isexternal.test.php
new file mode 100644
index 000000000..cf5f793e4
--- /dev/null
+++ b/_test/tests/inc/media_isexternal.test.php
@@ -0,0 +1,22 @@
+<?php
+
+class media_isexternal_test extends DokuWikiTest {
+
+
+ public function test_external(){
+ $this->assertTrue(media_isexternal('http://www.example.com/foo.png'));
+ $this->assertTrue(media_isexternal('https://www.example.com/foo.png'));
+ $this->assertTrue(media_isexternal('ftp://www.example.com/foo.png'));
+ $this->assertTrue(media_isexternal('hTTp://www.example.com/foo.png'));
+ $this->assertTrue(media_isexternal('hTTps://www.example.com/foo.png'));
+ $this->assertTrue(media_isexternal('Ftp://www.example.com/foo.png'));
+ }
+
+ public function test_internal(){
+ $this->assertFalse(media_isexternal('wiki:logo.png'));
+ $this->assertFalse(media_isexternal('private:logo.png'));
+ $this->assertFalse(media_isexternal('ftp:private:logo.png'));
+
+ }
+
+} \ No newline at end of file