setMwGlobals( 'wgTmpDirectory', '/hopefully invalid' ); $factory = $this->getServiceContainer()->getTempFSFileFactory(); $this->assertSame( '/hopefully invalid', ( TestingAccessWrapper::newFromObject( $factory ) )->tmpDirectory ); } // For TempFSFileTestTrait private function newFile() { return TempFSFile::factory( 'tmp' ); } }