wiki.techinc.nl/tests/phpunit/includes/libs/filebackend/fsfile/TempFSFileIntegrationTest.php
Aryeh Gregor a83b33582a TempFSFileFactory service
This replaces TempFSFile::factory(), which is now deprecated.

Change-Id: I9e65c3867e26c16687560dccc7d9f3e195a8bdd6
2019-08-21 16:26:05 +03:00

25 lines
654 B
PHP

<?php
use MediaWiki\MediaWikiServices;
use Wikimedia\TestingAccessWrapper;
/**
* Just to test one deprecated method and one line of ServiceWiring code.
*/
class TempFSFileIntegrationTest extends MediaWikiIntegrationTestCase {
/**
* @coversNothing
*/
public function testServiceWiring() {
$this->setMwGlobals( 'wgTmpDirectory', '/hopefully invalid' );
$factory = MediaWikiServices::getInstance()->getTempFSFileFactory();
$this->assertSame( '/hopefully invalid',
( TestingAccessWrapper::newFromObject( $factory ) )->tmpDirectory );
}
use TempFSFileTestTrait;
private function newFile() {
return TempFSFile::factory( 'tmp' );
}
}