public function testSuperUserAllDefaultControllerActions() { $super = $this->logoutCurrentUserLoginNewUserAndGetByUsername('super'); $this->assertEquals(0, SavedSearch::getCount()); //Test a saved search that validates and passes //Test form that validates $this->setGetArray(array('viewClassName' => 'AccountsSearchView', 'modelClassName' => 'Account', 'formModelClassName' => 'AccountsSearchForm')); $this->setPostArray(array('ajax' => 'search-form', 'AccountsSearchForm' => array('savedSearchName' => 'a new name'), 'save' => 'saveSearch')); $this->runControllerWithExitExceptionAndGetContent('zurmo/default/validateDynamicSearch'); $savedSearches = SavedSearch::getAll(); $this->assertEquals(1, count($savedSearches)); $this->assertEquals('a new name', $savedSearches[0]->name); //Test loading saved search Yii::app()->user->setState('AccountsSearchView', null); $this->setGetArray(array('savedSearchId' => $savedSearches[0]->id)); $content = $this->runControllerWithNoExceptionsAndGetContent('accounts/default/list'); $id = $savedSearches[0]->id; $this->assertContains("<option value=\"{$id}\" selected=\"selected\">a new name</option>", $content); //Test deleting saved search $this->setGetArray(array('id' => $savedSearches[0]->id)); $this->resetPostArray(); $this->runControllerWithNoExceptionsAndGetContent('zurmo/default/deleteSavedSearch', true); $this->assertEquals(0, SavedSearch::getCount()); }