Import: Handle uploads with sha1 starting with 0 properly
[mediawiki.git] / tests / phpunit / includes / FauxRequestTest.php
blob07214b215ca2f577fb6b6e68ad7ef98697679875
1 <?php
3 class FauxRequestTest extends MediaWikiTestCase {
4 /**
5 * @covers FauxRequest::setHeader
6 * @covers FauxRequest::getHeader
7 */
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 );
18 $this->assertEquals(
19 $request->getHeader( 'Accept', WebRequest::GETHEADER_LIST ),
20 array( 'text/plain', 'text/html' )
24 /**
25 * @covers FauxRequest::getAllHeaders
27 public function testGetAllHeaders() {
28 $_SERVER['HTTP_TEST'] = 'Example';
30 $request = new FauxRequest();
32 $this->assertEquals(
33 array(),
34 $request->getAllHeaders()
38 /**
39 * @covers FauxRequest::getHeader
41 public function testGetHeader() {
42 $_SERVER['HTTP_TEST'] = 'Example';
44 $request = new FauxRequest();
46 $this->assertEquals(
47 false,
48 $request->getHeader( 'test' )