示例#1
0
 public function testSend()
 {
     $file = __DIR__ . '/../../_files/javascript.js';
     $contentType = 'content/type';
     $this->response->expects($this->at(0))->method('setHeader')->with('Content-length', filesize($file));
     $this->response->expects($this->at(1))->method('setHeader')->with('Content-Type', $contentType);
     $this->response->expects($this->once())->method('sendHeaders');
     $this->mime->expects($this->once())->method('getMimeType')->with($file)->will($this->returnValue($contentType));
     $this->expectOutputString(file_get_contents($file));
     $this->object->send($file);
 }
示例#2
0
 public function testSetHeaderWithReplacing()
 {
     $this->response->expects($this->once())->method('getHeaders')->will($this->returnValue($this->headers));
     $this->response->expects($this->once())->method('clearHeader')->with('testName');
     $this->response->setHeader('testName', 'testValue', true);
 }