本文整理汇总了PHP中SavedSearch::getAll方法的典型用法代码示例。如果您正苦于以下问题:PHP SavedSearch::getAll方法的具体用法?PHP SavedSearch::getAll怎么用?PHP SavedSearch::getAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SavedSearch
的用法示例。
在下文中一共展示了SavedSearch::getAll方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testSuperUserAllDefaultControllerActions
public function testSuperUserAllDefaultControllerActions()
{
$super = $this->logoutCurrentUserLoginNewUserAndGetByUsername('super');
$this->assertEquals(0, count(SavedSearch::getAll()));
//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, count(SavedSearch::getAll()));
}