namespace MediaWiki\Session;
+use MediaWiki\MediaWikiServices;
use Psr\Log\LoggerInterface;
use BagOStuff;
use CachedBagOStuff;
* Reset the internal caching for unit testing
*/
public static function resetCache() {
- if ( !defined( 'MW_PHPUNIT_TEST' ) ) {
- // @codeCoverageIgnoreStart
- throw new MWException( __METHOD__ . ' may only be called from unit tests!' );
- // @codeCoverageIgnoreEnd
- }
+ MediaWikiServices::failUnlessBootstrapping( __METHOD__ );
self::$globalSession = null;
self::$globalSessionRequest = null;