/** * Display filter form and all software according to selected filter (default: accepted) * * @return array filter, form, software[] */ public function indexAction() { $filter = $this->params()->fromQuery('filter', 'accepted'); $this->_form->setFilter($filter); $this->_form->remove('_csrf'); $session = new \Zend\Session\Container('ManageSoftware'); $session->filter = $filter; $order = $this->getOrder('name'); return array('filter' => $filter, 'form' => $this->_form, 'software' => $this->_softwareManager->getSoftware(array('Os' => $this->params()->fromQuery('os', 'windows'), 'Status' => $filter), $order['order'], $order['direction']), 'order' => $order); }
public function testIndexActionFilterAll() { $filters = array('Os' => 'windows', 'Status' => 'all'); $this->_softwareManager->expects($this->once())->method('getSoftware')->with($filters, 'name', 'asc')->willReturn($this->_result); $this->_form->expects($this->once())->method('setFilter')->with('all'); $this->_form->expects($this->once())->method('render'); $this->dispatch('/console/software/index/?filter=all'); $this->assertEquals('all', $this->_session->filter); $this->assertResponseStatusCode(200); $this->assertNotQueryContentContains('td a', 'Akzeptieren'); $this->assertNotQueryContentContains('td a', 'Ignorieren'); }