Beispiel #1
0
 /**
  * Get priority form
  *
  * @return \Zend_Form
  */
 private function getForm()
 {
     $form = new Zend_Form();
     $resourceTypes = $this->auditService->getResourceTypes();
     $actionTypes = $this->auditService->getActionTypes();
     $form->addElement('select', 'resource_type', array('multioptions' => array('' => getGS('All')) + $resourceTypes, 'label' => getGS('Resource Type:'), 'onChange' => 'this.form.submit();'));
     $form->addElement('select', 'action_type', array('multioptions' => array('' => getGS('All')) + $actionTypes, 'label' => getGS('Action Type:'), 'onChange' => 'this.form.submit();'));
     return $form;
 }
 /**
  * Get priority form
  *
  * @return \Zend_Form
  */
 private function getForm()
 {
     $form = new Zend_Form();
     $translator = \Zend_Registry::get('container')->getService('translator');
     $resourceTypes = $this->auditService->getResourceTypes();
     $actionTypes = $this->auditService->getActionTypes();
     $form->addElement('select', 'resource_type', array('multioptions' => array('' => $translator->trans('All')) + $resourceTypes, 'label' => $translator->trans('Resource Type:', array(), 'logs'), 'onChange' => 'this.form.submit();'));
     $form->addElement('select', 'action_type', array('multioptions' => array('' => $translator->trans('All')) + $actionTypes, 'label' => $translator->trans('Action Type:', array(), 'logs'), 'onChange' => 'this.form.submit();'));
     return $form;
 }
Beispiel #3
0
 public function testFindBy()
 {
     $result = array(1, 2, 4);
     $criteria = array('resource' => 'article');
     $orderBy = array('created');
     $limit = 5;
     $offset = 1;
     $this->repository->expects($this->once())->method('findBy')->with($this->equalTo($criteria), $this->equalTo($orderBy), $this->equalTo($limit), $this->equalTo($offset))->will($this->returnValue($result));
     $this->em->expects($this->once())->method('getRepository')->with($this->equalTo('Newscoop\\Entity\\AuditEvent'))->will($this->returnValue($this->repository));
     $this->assertEquals($result, $this->service->findBy($criteria, $orderBy, $limit, $offset));
 }