xref: /dokuwiki/_test/tests/inc/common_mediainfo.test.php (revision 1c33cec37215d0c964cf961bdbc49ae7db3657e6)
17ae29fa4SChristopher Smith<?php
27ae29fa4SChristopher Smith
37ae29fa4SChristopher Smithclass common_basicinfo_test extends DokuWikiTest {
47ae29fa4SChristopher Smith
5*1c33cec3SAndreas Gohr    function setup() : void {
67ae29fa4SChristopher Smith        parent::setup();
77ae29fa4SChristopher Smith
87ae29fa4SChristopher Smith        global $USERINFO;
97ae29fa4SChristopher Smith        $USERINFO = array(
107ae29fa4SChristopher Smith           'pass' => '179ad45c6ce2cb97cf1029e212046e81',
117ae29fa4SChristopher Smith           'name' => 'Arthur Dent',
127ae29fa4SChristopher Smith           'mail' => 'arthur@example.com',
137ae29fa4SChristopher Smith           'grps' => array ('admin','user'),
147ae29fa4SChristopher Smith        );
157ae29fa4SChristopher Smith        $_SERVER['REMOTE_USER'] = 'testuser';
167ae29fa4SChristopher Smith        $_SERVER['REMOTE_ADDR'] = '1.2.3.4';
177ae29fa4SChristopher Smith    }
187ae29fa4SChristopher Smith
197ae29fa4SChristopher Smith    function _get_info() {
207ae29fa4SChristopher Smith        global $USERINFO;
217ae29fa4SChristopher Smith        $info = array (
227ae29fa4SChristopher Smith          'isadmin' => true,
237ae29fa4SChristopher Smith          'ismanager' => true,
247ae29fa4SChristopher Smith          'userinfo' => $USERINFO,
257ae29fa4SChristopher Smith          'perm' => 255,
267ae29fa4SChristopher Smith          'namespace' => false,
277ae29fa4SChristopher Smith          'ismobile' => false,
287ae29fa4SChristopher Smith          'client' => 'testuser',
297ae29fa4SChristopher Smith        );
307ae29fa4SChristopher Smith
317ae29fa4SChristopher Smith        return $info;
327ae29fa4SChristopher Smith    }
337ae29fa4SChristopher Smith
347ae29fa4SChristopher Smith    /**
357ae29fa4SChristopher Smith     * We're interested in the extra keys for $INFO when its a media request
367ae29fa4SChristopher Smith     */
377ae29fa4SChristopher Smith    function test_mediainfo(){
387ae29fa4SChristopher Smith        global $NS, $IMG;
397ae29fa4SChristopher Smith        $NS = '';
407ae29fa4SChristopher Smith        $IMG = 'testimage.png';
417ae29fa4SChristopher Smith
427ae29fa4SChristopher Smith        $info = $this->_get_info();
437ae29fa4SChristopher Smith        $info['image'] = 'testimage.png';
447ae29fa4SChristopher Smith
457ae29fa4SChristopher Smith        $this->assertEquals(mediainfo(),$info);
467ae29fa4SChristopher Smith    }
477ae29fa4SChristopher Smith}
487ae29fa4SChristopher Smith
497ae29fa4SChristopher Smith//Setup VIM: ex: et ts=4 :
50