Example #1
0
 public function testPrepareParamsEmptySet()
 {
     $set = [];
     $params = Request\prepareParams($set);
     $this->assertNotNull($params);
     $this->assertEquals($params, []);
 }
Example #2
0
/**
 * Processes the request to build a response.
 *
 * @param $routes  array
 * @param $options array
 * @return string
 */
function run(array $routes, array $options = [])
{
    $paramSet = isset($options['param_set']) ? $options['param_set'] : [];
    $params = Request\prepareParams($paramSet);
    $request = Request\parse($params);
    $response = Response\create();
    $pipeline = wrapPipeline($request, $routes, $options);
    return Util\pipe($pipeline, ['request' => $request, 'response' => $response]);
}