public function testGetHeaderNames() { $r = new Horde_Controller_Request_Mock(array('SERVER' => array('HTTP_TEST' => 'test'))); $this->assertEquals(array('test'), $r->getHeaderNames()); }
private function _provider($path) { $request = new Horde_Controller_Request_Mock(); $request->setPath($path); return new Horde_Kolab_FreeBusy_Provider_Remote_Redirect($this->getRemoteOwner(), $request); }
protected function getTestMatchDict($type = 'fetch') { switch ($type) { case 'empty': $route = 'trigger/*(folder).pfb'; $match = array('controller' => 'freebusy', 'action' => 'trigger'); $path = '/trigger/.pfb'; break; case 'invalid': $route = 'trigger/*(folder).pfb'; $match = array('controller' => 'freebusy', 'action' => 'trigger'); $path = '/trigger/INVALID.pfb'; break; case 'trigger': $route = 'trigger/*(folder).pfb'; $match = array('controller' => 'freebusy', 'action' => 'trigger'); $path = '/trigger/owner@example.org/Kalender.pfb'; break; case 'fetch': default: $route = ':(owner).:(type)'; $match = array('controller' => 'freebusy', 'action' => 'fetch', 'requirements' => array('type' => '(i|x|v)fb', 'owner' => '[^/]+')); $path = '/owner@example.org.xfb'; break; } $mapper = new Horde_Routes_Mapper(); $mapper->connect($route, $match); $request = new Horde_Controller_Request_Mock(); $request->setPath($path); return new Horde_Kolab_FreeBusy_Controller_MatchDict($mapper, $request); }
private function _provider($path, $code = 200) { $request = new Horde_Controller_Request_Mock(); $request->setPath($path); return new Horde_Kolab_FreeBusy_Provider_Remote_PassThrough($this->getRemoteOwner(), $request, $this->_getUser(), $this->getHttpClient('RESPONSE', $code)); }