'Test 1', 'test2' => 'Test 2', ); $dashlet = new Dashlet('unit_test_run'); $dashlet->storeOptions($options); $prefs = $GLOBALS['current_user']->getPreference('dashlets', 'Home'); $this->assertEquals($options,$prefs['unit_test_run']['options']); return $GLOBALS['current_user']; } /** * @depends testCanStoreOptions */ public function testCanLoadOptions(User $user) { $GLOBALS['current_user'] = $user; $options = array( 'test1' => 'Test 1', 'test2' => 'Test 2', ); $dashlet = new Dashlet('unit_test_run'); $this->assertEquals($options,$dashlet->loadOptions()); } public function testLoadOptionsReturnsEmptyArrayIfNoPreferencesSet() { $dashlet = new Dashlet('unit_test_run'); $this->assertEquals(array(),$dashlet->loadOptions()); } }