aboutsummaryrefslogtreecommitdiffstats
path: root/tests/phpunit/unit/includes/DerivativeRequestTest.php
blob: cad39fdaa36bff43c6b00c13cc4952a37b50a65f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<?php

/**
 * @covers DerivativeRequest
 */
class DerivativeRequestTest extends MediaWikiUnitTestCase {

	public function testSetIp() {
		$original = new WebRequest();
		$original->setIP( '1.2.3.4' );
		$derivative = new DerivativeRequest( $original, [] );

		$this->assertEquals( '1.2.3.4', $derivative->getIP() );

		$derivative->setIP( '5.6.7.8' );

		$this->assertEquals( '5.6.7.8', $derivative->getIP() );
		$this->assertEquals( '1.2.3.4', $original->getIP() );
	}

}