| Total Complexity | 9 | 
| Total Lines | 66 | 
| Duplicated Lines | 0 % | 
| Coverage | 0% | 
| Changes | 1 | ||
| Bugs | 0 | Features | 0 | 
| 1 | <?php | ||
| 9 | class MockOutputProcessor extends BaseOutputProcessor | ||
| 10 | { | ||
| 11 | /** | ||
| 12 | * @var OutputProcessorInterface | ||
| 13 | */ | ||
| 14 | protected $originalOutputProcessor; | ||
| 15 | |||
| 16 | public function __construct($class) | ||
| 17 |     { | ||
| 18 | $this->originalOutputProcessor = new $class(); | ||
| 19 | } | ||
| 20 | |||
| 21 | protected function writeHeader(HttpResponse $response) | ||
| 22 |     { | ||
| 23 | echo "HTTP/1.1 " . $response->getResponseCode() . "\r\n"; | ||
| 24 | echo "Content-Type: " . $this->getContentType() . "\r\n"; | ||
| 25 | |||
| 26 |         foreach ($response->getHeaders() as $header) { | ||
| 27 |             if (is_array($header)) { | ||
| 28 |                 echo "${header[0]}: ${header[1]}\n"; | ||
| 29 | continue; | ||
| 30 | } | ||
| 31 | echo "$header\n"; | ||
| 32 | } | ||
| 33 | |||
| 34 | echo "\r\n"; | ||
| 35 | } | ||
| 36 | |||
| 37 | public function getContentType() | ||
| 40 | } | ||
| 41 | |||
| 42 | |||
| 43 | /** | ||
| 44 | * @return void | ||
| 45 | */ | ||
| 46 | public function writeContentType() | ||
| 48 | // Do nothing; | ||
| 49 | } | ||
| 50 | |||
| 51 | |||
| 52 | /** | ||
| 53 | * @return Handler | ||
| 54 | */ | ||
| 55 | public function getDetailedErrorHandler() | ||
| 56 |     { | ||
| 57 | return $this->originalOutputProcessor->getDetailedErrorHandler(); | ||
| 58 | } | ||
| 59 | |||
| 60 | /** | ||
| 61 | * @return Handler | ||
| 62 | */ | ||
| 63 | public function getErrorHandler() | ||
| 64 |     { | ||
| 65 | return $this->originalOutputProcessor->getErrorHandler(); | ||
| 66 | } | ||
| 67 | |||
| 68 | |||
| 69 | /** | ||
| 70 | * @return FormatterInterface | ||
| 71 | */ | ||
| 72 | public function getFormatter() | ||
| 75 | } | ||
| 76 | } | ||
| 77 |