public function testOutputReadFileError() { $path = __FILE__; $this->output->expects($this->once())->method('getHttpResponseCode')->will($this->returnValue(Http::STATUS_OK)); $this->output->expects($this->once())->method('setReadfile')->will($this->returnValue(false)); $this->output->expects($this->once())->method('setHttpResponseCode')->with($this->equalTo(Http::STATUS_BAD_REQUEST)); $response = new StreamResponse($path); $response->callback($this->output); }