| Total Complexity | 10 | 
| Total Lines | 67 | 
| Duplicated Lines | 0 % | 
| Coverage | 31.58% | 
| Changes | 1 | ||
| Bugs | 0 | Features | 0 | 
| 1 | <?php | ||
| 9 | class MockOutputProcessor extends BaseOutputProcessor | ||
| 10 | { | ||
| 11 | /** | ||
| 12 | * @var OutputProcessorInterface | ||
| 13 | */ | ||
| 14 | protected $originalOutputProcessor; | ||
| 15 | |||
| 16 | 5 | public function __construct($class) | |
| 17 |     { | ||
| 18 | 5 | $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 => $value) { | ||
| 27 |             if (is_array($value)) { | ||
| 28 |                 foreach ($value as $headerValue) { | ||
| 29 | echo "$header: $headerValue\r\n"; | ||
| 30 | } | ||
| 31 |             } else { | ||
| 32 | echo "$header: $value\r\n"; | ||
| 33 | } | ||
| 34 | } | ||
| 35 | echo "\r\n"; | ||
| 36 | } | ||
| 37 | |||
| 38 | public function getContentType() | ||
| 41 | } | ||
| 42 | |||
| 43 | |||
| 44 | /** | ||
| 45 | * @return void | ||
| 46 | */ | ||
| 47 | public function writeContentType() | ||
| 48 |     { | ||
| 49 | // Do nothing; | ||
| 50 | } | ||
| 51 | |||
| 52 | |||
| 53 | /** | ||
| 54 | * @return Handler | ||
| 55 | */ | ||
| 56 | public function getDetailedErrorHandler() | ||
| 57 |     { | ||
| 58 | return $this->originalOutputProcessor->getDetailedErrorHandler(); | ||
| 59 | } | ||
| 60 | |||
| 61 | /** | ||
| 62 | * @return Handler | ||
| 63 | */ | ||
| 64 | 5 | public function getErrorHandler() | |
| 65 |     { | ||
| 66 | 5 | return $this->originalOutputProcessor->getErrorHandler(); | |
| 67 | } | ||
| 68 | |||
| 69 | |||
| 70 | /** | ||
| 71 | * @return FormatterInterface | ||
| 72 | */ | ||
| 73 | 2 | public function getFormatter() | |
| 76 | } | ||
| 77 | } | ||
| 78 |