X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2Fsession%2FPHPSessionHandlerTest.php;h=0a2e84e11a454f56caaf10731da4510fb223c8a2;hb=64b83bdb3afd0ee4f8fc1893a865409c198e601e;hp=34e5e449a307a0423c986d1f6847e180882d3881;hpb=dcdb8e463e3b2be121c61c91df13ea36d270a602;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/session/PHPSessionHandlerTest.php b/tests/phpunit/includes/session/PHPSessionHandlerTest.php index 34e5e449a3..0a2e84e11a 100644 --- a/tests/phpunit/includes/session/PHPSessionHandlerTest.php +++ b/tests/phpunit/includes/session/PHPSessionHandlerTest.php @@ -4,6 +4,7 @@ namespace MediaWiki\Session; use Psr\Log\LogLevel; use MediaWikiTestCase; +use Wikimedia\TestingAccessWrapper; /** * @group Session @@ -26,7 +27,7 @@ class PHPSessionHandlerTest extends MediaWikiTestCase { $rProp = new \ReflectionProperty( PHPSessionHandler::class, 'instance' ); $rProp->setAccessible( true ); if ( $rProp->getValue() ) { - $old = \TestingAccessWrapper::newFromObject( $rProp->getValue() ); + $old = TestingAccessWrapper::newFromObject( $rProp->getValue() ); $oldManager = $old->manager; $oldStore = $old->store; $oldLogger = $old->logger; @@ -40,7 +41,7 @@ class PHPSessionHandlerTest extends MediaWikiTestCase { } public function testEnableFlags() { - $handler = \TestingAccessWrapper::newFromObject( + $handler = TestingAccessWrapper::newFromObject( $this->getMockBuilder( PHPSessionHandler::class ) ->setMethods( null ) ->disableOriginalConstructor() @@ -93,7 +94,7 @@ class PHPSessionHandlerTest extends MediaWikiTestCase { $this->assertFalse( wfIniGetBool( 'session.use_trans_sid' ) ); $this->assertNotNull( $rProp->getValue() ); - $priv = \TestingAccessWrapper::newFromObject( $rProp->getValue() ); + $priv = TestingAccessWrapper::newFromObject( $rProp->getValue() ); $this->assertSame( $manager, $priv->manager ); $this->assertSame( $store, $priv->store ); $this->assertSame( $logger, $priv->logger ); @@ -122,7 +123,7 @@ class PHPSessionHandlerTest extends MediaWikiTestCase { 'logger' => $logger, ] ); PHPSessionHandler::install( $manager ); - $wrap = \TestingAccessWrapper::newFromObject( $rProp->getValue() ); + $wrap = TestingAccessWrapper::newFromObject( $rProp->getValue() ); $reset[] = new \Wikimedia\ScopedCallback( [ $wrap, 'setEnableFlags' ], [ $wrap->enable ? $wrap->warn ? 'warn' : 'enable' : 'disable' ] @@ -323,7 +324,7 @@ class PHPSessionHandlerTest extends MediaWikiTestCase { ->setMethods( null ) ->disableOriginalConstructor() ->getMock(); - \TestingAccessWrapper::newFromObject( $handler )->setEnableFlags( 'disable' ); + TestingAccessWrapper::newFromObject( $handler )->setEnableFlags( 'disable' ); $oldValue = $rProp->getValue(); $rProp->setValue( $handler ); $reset = new \Wikimedia\ScopedCallback( [ $rProp, 'setValue' ], [ $oldValue ] ); @@ -350,7 +351,7 @@ class PHPSessionHandlerTest extends MediaWikiTestCase { ->setMethods( null ) ->disableOriginalConstructor() ->getMock(); - \TestingAccessWrapper::newFromObject( $handler )->setEnableFlags( 'enable' ); + TestingAccessWrapper::newFromObject( $handler )->setEnableFlags( 'enable' ); call_user_func_array( [ $handler, $method ], $args ); }