wiki.techinc.nl/tests/phpunit/includes/MediaWikiVersionFetcherTest.php
Amir Sarabadani d23af35764 Unset all globals unneeded for unit tests, assert correct directory
* Unset globals to avoid tests that look like unit tests but actually rely on
  globals
* move some tests out of unit directory so that the test suite will pass.
* Assert that tests which extend MediaWikiUnitTestCase are in a directory with
  "/unit/" in its path name

Depends-On: I67b37b1bde94eaa3d4298d9bd98ac57995ce93b9
Depends-On: I90921679518ee95fe393f8b1bbd9134daf0ba032
Bug: T87781
Change-Id: I16691fc8ac063705ba0c2bc63b96c4534ca8660b
2019-07-09 14:09:29 -04:00

21 lines
587 B
PHP

<?php
/**
* Note: this is not a unit test, as it touches the file system and reads an actual file.
* If unit tests are added for MediaWikiVersionFetcher, this should be done in a distinct test case.
*
* @covers MediaWikiVersionFetcher
*
* @group ComposerHooks
*
* @author Jeroen De Dauw < jeroendedauw@gmail.com >
*/
class MediaWikiVersionFetcherTest extends \MediaWikiIntegrationTestCase {
public function testReturnsResult() {
global $wgVersion;
$versionFetcher = new MediaWikiVersionFetcher();
$this->assertSame( $wgVersion, $versionFetcher->fetchVersion() );
}
}