public function testFilter() { $response = new ezcMvcResponse(); $response->body = 'Ze Body'; $filter = new ezcMvcGzipResponseFilter(); $filter->filterResponse($response); self::assertSame('gzip', $response->content->encoding); self::assertSame(gzencode('Ze Body'), $response->body); }
function runResponseFilters(ezcMvcRoutingInformation $routeInfo, ezcMvcRequest $request, ezcMvcResult $result, ezcMvcResponse $response) { if (!ezcBase::inDevMode()) { if (in_array('gzip', $request->accept->encodings)) { $filter = new ezcMvcGzipResponseFilter(); $filter->filterResponse($response); } else { if (in_array('deflate', $request->accept->encodings)) { $filter = new ezcMvcGzDeflateResponseFilter(); $filter->filterResponse($response); } } } }