3 class FauxRequestTest
extends MediaWikiTestCase
{
5 * @covers FauxRequest::setHeader
6 * @covers FauxRequest::getHeader
8 public function testGetSetHeader() {
9 $value = 'text/plain, text/html';
11 $request = new FauxRequest();
12 $request->setHeader( 'Accept', $value );
14 $this->assertEquals( $request->getHeader( 'Nonexistent' ), false );
15 $this->assertEquals( $request->getHeader( 'Accept' ), $value );
16 $this->assertEquals( $request->getHeader( 'ACCEPT' ), $value );
17 $this->assertEquals( $request->getHeader( 'accept' ), $value );
19 $request->getHeader( 'Accept', WebRequest
::GETHEADER_LIST
),
20 array( 'text/plain', 'text/html' )
25 * @covers FauxRequest::getAllHeaders
27 public function testGetAllHeaders() {
28 $_SERVER['HTTP_TEST'] = 'Example';
30 $request = new FauxRequest();
34 $request->getAllHeaders()
39 * @covers FauxRequest::getHeader
41 public function testGetHeader() {
42 $_SERVER['HTTP_TEST'] = 'Example';
44 $request = new FauxRequest();
48 $request->getHeader( 'test' )