public static function getFormatter($format) { if (!static::hasFormatter($format)) { throw new NotAcceptableHttpException('Unable to format response according to Accept header.'); } return static::$formatters[$format]; }
/** * @expectedException \RuntimeException */ public function testGettingUnregisteredFormatterThrowsException() { Response::getFormatter('test'); }