/** * Constructor for a request. * * @param string $controller The controller being requested. * @param object $payload The action being invoked. * @param string $verb (optional) The HTTP verb (usually POST). */ public function __construct($controller, $payload, $verb = 'POST') { // extract a minimal "action" value from the payload $action = ''; if (is_object($payload) && isset($payload->method)) { $action = $payload->method; } parent::__construct($controller, $action, $verb); $this->payload = $payload; }
/** * Tests the various filters. * @dataProvider filtersProvider */ public function testInputFilters($expected, $value, $filters) { $request = new HttpRequest('TestService', 'TestMethod', 'GET'); $request->setQuery(array('key' => $value)); $this->assertTrue($expected === $request->getQuery('key', null, $filters)); }