xref: /dokuwiki/_test/tests/inc/common_mediainfo.test.php (revision 7ae29fa453970036576e8b18fe228c24a25e94ff)
1*7ae29fa4SChristopher Smith<?php
2*7ae29fa4SChristopher Smith
3*7ae29fa4SChristopher Smithclass common_basicinfo_test extends DokuWikiTest {
4*7ae29fa4SChristopher Smith
5*7ae29fa4SChristopher Smith    function setup(){
6*7ae29fa4SChristopher Smith        parent::setup();
7*7ae29fa4SChristopher Smith
8*7ae29fa4SChristopher Smith        global $USERINFO;
9*7ae29fa4SChristopher Smith        $USERINFO = array(
10*7ae29fa4SChristopher Smith           'pass' => '179ad45c6ce2cb97cf1029e212046e81',
11*7ae29fa4SChristopher Smith           'name' => 'Arthur Dent',
12*7ae29fa4SChristopher Smith           'mail' => 'arthur@example.com',
13*7ae29fa4SChristopher Smith           'grps' => array ('admin','user'),
14*7ae29fa4SChristopher Smith        );
15*7ae29fa4SChristopher Smith        $_SERVER['REMOTE_USER'] = 'testuser';
16*7ae29fa4SChristopher Smith        $_SERVER['REMOTE_ADDR'] = '1.2.3.4';
17*7ae29fa4SChristopher Smith    }
18*7ae29fa4SChristopher Smith
19*7ae29fa4SChristopher Smith    function _get_info() {
20*7ae29fa4SChristopher Smith        global $USERINFO;
21*7ae29fa4SChristopher Smith        $info = array (
22*7ae29fa4SChristopher Smith          'isadmin' => true,
23*7ae29fa4SChristopher Smith          'ismanager' => true,
24*7ae29fa4SChristopher Smith          'userinfo' => $USERINFO,
25*7ae29fa4SChristopher Smith          'perm' => 255,
26*7ae29fa4SChristopher Smith          'namespace' => false,
27*7ae29fa4SChristopher Smith          'ismobile' => false,
28*7ae29fa4SChristopher Smith          'client' => 'testuser',
29*7ae29fa4SChristopher Smith        );
30*7ae29fa4SChristopher Smith
31*7ae29fa4SChristopher Smith        return $info;
32*7ae29fa4SChristopher Smith    }
33*7ae29fa4SChristopher Smith
34*7ae29fa4SChristopher Smith    /**
35*7ae29fa4SChristopher Smith     * We're interested in the extra keys for $INFO when its a media request
36*7ae29fa4SChristopher Smith     */
37*7ae29fa4SChristopher Smith    function test_mediainfo(){
38*7ae29fa4SChristopher Smith        global $NS, $IMG;
39*7ae29fa4SChristopher Smith        $NS = '';
40*7ae29fa4SChristopher Smith        $IMG = 'testimage.png';
41*7ae29fa4SChristopher Smith
42*7ae29fa4SChristopher Smith        $info = $this->_get_info();
43*7ae29fa4SChristopher Smith        $info['image'] = 'testimage.png';
44*7ae29fa4SChristopher Smith
45*7ae29fa4SChristopher Smith        $this->assertEquals(mediainfo(),$info);
46*7ae29fa4SChristopher Smith    }
47*7ae29fa4SChristopher Smith}
48*7ae29fa4SChristopher Smith
49*7ae29fa4SChristopher Smith//Setup VIM: ex: et ts=4 :
50