summaryrefslogtreecommitdiff
path: root/_test/tests/inc/common_mediainfo.test.php
blob: cc5b17ec7df1aaea4b805ce83bd831460febb311 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?php

class common_basicinfo_test extends DokuWikiTest {
 
    function setup(){
        parent::setup();

        global $USERINFO; 
        $USERINFO = array(
           'pass' => '179ad45c6ce2cb97cf1029e212046e81',
           'name' => 'Arthur Dent',
           'mail' => 'arthur@example.com',
           'grps' => array ('admin','user'),
        );
        $_SERVER['REMOTE_USER'] = 'testuser';
        $_SERVER['REMOTE_ADDR'] = '1.2.3.4';
    }
    
    function _get_info() {
        global $USERINFO;
        $info = array (
          'isadmin' => true,
          'ismanager' => true,
          'userinfo' => $USERINFO,
          'perm' => 255,
          'namespace' => false,
          'ismobile' => false,
          'client' => 'testuser',
        );
      
        return $info;
    }
    
    /**
     * We're interested in the extra keys for $INFO when its a media request
     */
    function test_mediainfo(){
        global $NS, $IMG;
        $NS = '';
        $IMG = 'testimage.png';
         
        $info = $this->_get_info();
        $info['image'] = 'testimage.png';
        
        $this->assertEquals(mediainfo(),$info);
    }
}

//Setup VIM: ex: et ts=4 :