Flintstones\Rest\Tests\ServiceProviderTest::testFormatDetection PHP Method

testFormatDetection() public method

public testFormatDetection ( Silex\Application $app )
$app Silex\Application
    public function testFormatDetection(Application $app)
    {
        $app->get('/api/user/{id}', function ($id) use($app) {
            return $app['request']->getRequestFormat();
        });
        $request = Request::create('/api/user/1');
        $request->headers->set('Accept', 'application/json');
        $response = $app->handle($request, HttpKernelInterface::MASTER_REQUEST, false);
        $this->assertEquals('json', $response->getContent());
    }