wiki.techinc.nl/tests/phpunit/unit/includes/DerivativeRequestTest.php
Func 4d1da6f7f8 phpunit: Update @covers annotations for namespaced classes
We renamed many classes to be namespaced, but the `@covers` and
`@coversDefaultClass` annotations weren't updated properly.

PHPUnit didn't support short cover annotations with `use` statements,
these didn't trigger any errors yet, because they are class alias.

This patch is populated by a modified version of PhpunitAnnotationsSniff.

Change-Id: I6c602290a30099239b17d2dc0d67b1488b4eaeeb
2023-05-27 17:43:12 +08:00

23 lines
533 B
PHP

<?php
use MediaWiki\Request\DerivativeRequest;
/**
* @covers MediaWiki\Request\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() );
}
}