/** * @depends testMakeSavedSearchBySearchForm */ public function testResolveSearchFormByGetData() { $savedSearches = SavedSearch::getByName('myTest'); $this->assertEquals(1, count($savedSearches)); $getData = array('savedSearchId' => $savedSearches[0]->id, 'anyMixedAttributes' => 'a search', 'anyMixedAttributesScope' => 'some', 'dynamicStructure' => '1 or 5', 'dynamicClauses' => array('a', 'b'), SearchForm::SELECTED_LIST_ATTRIBUTES => array('aaaMember', 'aaaMember2')); $searchForm = new AAASavedDynamicSearchFormTestModel(new AAA()); $listAttributesSelector = new ListAttributesSelector('AListView', 'TestModule'); $searchForm->setListAttributesSelector($listAttributesSelector); $searchForm->setKanbanBoard(new KanbanBoard(new AAA(), 'industry')); SavedSearchUtil::resolveSearchFormByData($getData, $searchForm); $this->assertEquals('myTest', $searchForm->savedSearchName); $this->assertEquals('abcdef', $searchForm->anyMixedAttributes); $this->assertEquals('xyz', $searchForm->getAnyMixedAttributesScope()); $this->assertEquals('1 or 6', $searchForm->dynamicStructure); $this->assertEquals(array('a', 'b'), $searchForm->dynamicClauses); $this->assertEquals(array('aaaMember', 'aaaMember2'), $searchForm->getListAttributesSelector()->getSelected()); $this->assertEquals(array('c', 'd'), $searchForm->getKanbanBoard()->getGroupByAttributeVisibleValues()); $this->assertEquals('red', $searchForm->getKanbanBoard()->getSelectedTheme()); }