/** * Overridden from ViewList prepareSearchForm so we can tack on some additional where clauses * */ function prepareSearchForm() { parent::prepareSearchForm(); require_once 'modules/Employees/EmployeesSearchForm.php'; $newForm = new EmployeesSearchForm($this->searchForm); $this->searchForm = $newForm; }
function testOverrideSearchFields() { $list = new ViewList(); $list->module = "Contacts"; $list->seed = new Contact(); $list->prepareSearchForm(); $this->assertTrue(isset($list->searchForm->searchFields['test'])); }
public function testdisplay() { $view = new ViewList(); //test without setting bean attibute. it shuold return no access html. ob_start(); $view->display(); $renderedContent1 = ob_get_contents(); ob_end_clean(); $this->assertGreaterThan(0, strlen($renderedContent1)); //test with bean, seed and other arrtibutes set. it shuold return html. $view->bean = new User(); $view->seed = new User(); $view->module = 'Users'; $view->prepareSearchForm(); $view->preDisplay(); ob_start(); $view->display(); $renderedContent2 = ob_get_contents(); ob_end_clean(); $this->assertGreaterThan(0, strlen($renderedContent2)); }