diff options
author | Gergő Tisza <gtisza@wikimedia.org> | 2017-04-19 19:37:35 +0000 |
---|---|---|
committer | Gergő Tisza <gtisza@wikimedia.org> | 2017-04-20 14:15:57 +0000 |
commit | 525bfbc8df855aa12e01868d92532cd64482dc7d (patch) | |
tree | d21f1ef446c1057ddb7979a81f41709e164a33db /tests/phpunit/includes/session/PHPSessionHandlerTest.php | |
parent | 8d4cda3ce5cf4b287877ea6f847a31c8ed7d83d8 (diff) | |
download | mediawikicore-525bfbc8df855aa12e01868d92532cd64482dc7d.tar.gz mediawikicore-525bfbc8df855aa12e01868d92532cd64482dc7d.zip |
Switch to librarized version of TestingAccessWrapper
Replaces \TestingAccessWrapper (defined in core) with
\Wikimedia\TestingAccessWrapper (defined in the composer package
wikimedia/testing-access-wrapper).
See https://gerrit.wikimedia.org/r/#/q/topic:librarize-testing-access-wrapper
for downstream patches.
The core version of the class is kept around for a while to avoid
circular dependency problems.
Bug: T163434
Change-Id: I52cc257e593da3d6c3b01a909e554a950225aec8
Diffstat (limited to 'tests/phpunit/includes/session/PHPSessionHandlerTest.php')
-rw-r--r-- | tests/phpunit/includes/session/PHPSessionHandlerTest.php | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/tests/phpunit/includes/session/PHPSessionHandlerTest.php b/tests/phpunit/includes/session/PHPSessionHandlerTest.php index 34e5e449a307..0a2e84e11a45 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 ); } |