3 class common_infofunctions_test
extends DokuWikiTest
{
5 function setup() : void
{
10 'pass' => '179ad45c6ce2cb97cf1029e212046e81',
11 'name' => 'Arthur Dent',
12 'mail' => 'arthur@example.com',
13 'grps' => array ('admin','user'),
15 $_SERVER['REMOTE_USER'] = 'testuser';
16 $_SERVER['REMOTE_ADDR'] = '1.2.3.4';
19 function _get_info() {
24 'userinfo' => $USERINFO,
28 'client' => 'testuser',
35 * Its important to have the correct set of keys.
36 * Other functions provide the values
38 function test_basicinfo(){
40 // test with REMOTE_USER set and the user an admin user
41 $info = $this->_get_info();
42 $this->assertEquals(basicinfo($ID,true),$info);
44 // with $httpclient parameter set to false
45 unset($info['ismobile']);
46 $this->assertEquals(basicinfo($ID,false),$info);
48 // with anonymous user
49 unset($_SERVER['REMOTE_USER']);
50 global $USERINFO; $USERINFO = array();
58 'client' => '1.2.3.4',
60 $this->assertEquals(basicinfo($ID,true),$info);
65 //Setup VIM: ex: et ts=4 :