/**
  * @covers FauxRequest::setHeader
  * @covers FauxRequest::getHeader
  */
 public function testGetSetHeader()
 {
     $value = 'test/test';
     $request = new FauxRequest();
     $request->setHeader('Content-Type', $value);
     $this->assertEquals($request->getHeader('Content-Type'), $value);
     $this->assertEquals($request->getHeader('CONTENT-TYPE'), $value);
     $this->assertEquals($request->getHeader('content-type'), $value);
 }
Ejemplo n.º 2
0
 /**
  * @covers FauxRequest::setHeader
  * @covers FauxRequest::getHeader
  */
 public function testGetSetHeader()
 {
     $value = 'text/plain, text/html';
     $request = new FauxRequest();
     $request->setHeader('Accept', $value);
     $this->assertEquals($request->getHeader('Nonexistent'), false);
     $this->assertEquals($request->getHeader('Accept'), $value);
     $this->assertEquals($request->getHeader('ACCEPT'), $value);
     $this->assertEquals($request->getHeader('accept'), $value);
     $this->assertEquals($request->getHeader('Accept', WebRequest::GETHEADER_LIST), array('text/plain', 'text/html'));
 }
Ejemplo n.º 3
0
 /**
  * @covers FauxRequest::getHeader
  */
 public function testGetHeader()
 {
     $_SERVER['HTTP_TEST'] = 'Example';
     $request = new FauxRequest();
     $this->assertEquals(false, $request->getHeader('test'));
 }