summaryrefslogtreecommitdiff
path: root/_test/tests/inc/media_isexternal.test.php
blob: cf5f793e4e2ccf970fcd66ec8525e7bf8595fd7b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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'));

    }

}