Esempio n. 1
0
 /**
  * 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;
 }
Esempio n. 2
0
 function testOverrideSearchFields()
 {
     $list = new ViewList();
     $list->module = "Contacts";
     $list->seed = new Contact();
     $list->prepareSearchForm();
     $this->assertTrue(isset($list->searchForm->searchFields['test']));
 }
Esempio n. 3
0
 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));
 }