/** * Its important to have the correct set of keys. * Other functions provide the values */ function test_basicinfo() { // test with REMOTE_USER set and the user an admin user $info = $this->_get_info(); $this->assertEquals(basicinfo($ID, true), $info); // with $httpclient parameter set to false unset($info['ismobile']); $this->assertEquals(basicinfo($ID, false), $info); // with anonymous user unset($_SERVER['REMOTE_USER']); global $USERINFO; $USERINFO = array(); $info = array('isadmin' => false, 'ismanager' => false, 'perm' => 8, 'namespace' => false, 'ismobile' => false, 'client' => '1.2.3.4'); $this->assertEquals(basicinfo($ID, true), $info); }
/** * Return information about the current media item as an associative array. * * @return array with info about current media item */ function mediainfo() { global $NS; global $IMG; $info = basicinfo("{$NS}:*"); $info['image'] = $IMG; return $info; }