X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2Fsession%2FTokenTest.php;h=47976527ca281c0ab6eb9b1be8466bf26017ef64;hb=f7e1770fb832aa77bf4e16ce8cc815f2b24dd10d;hp=113f409e0ccc74df54f166757c3a0365c5b944da;hpb=87d3bd7afcec9a4149104bf34b892a5e78a73c5c;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/session/TokenTest.php b/tests/phpunit/includes/session/TokenTest.php index 113f409e0c..47976527ca 100644 --- a/tests/phpunit/includes/session/TokenTest.php +++ b/tests/phpunit/includes/session/TokenTest.php @@ -3,6 +3,7 @@ namespace MediaWiki\Session; use MediaWikiTestCase; +use Wikimedia\TestingAccessWrapper; /** * @group Session @@ -11,9 +12,9 @@ use MediaWikiTestCase; class TokenTest extends MediaWikiTestCase { public function testBasics() { - $token = $this->getMockBuilder( 'MediaWiki\\Session\\Token' ) - ->setMethods( array( 'toStringAtTimestamp' ) ) - ->setConstructorArgs( array( 'sekret', 'salty', true ) ) + $token = $this->getMockBuilder( Token::class ) + ->setMethods( [ 'toStringAtTimestamp' ] ) + ->setConstructorArgs( [ 'sekret', 'salty', true ] ) ->getMock(); $token->expects( $this->any() )->method( 'toStringAtTimestamp' ) ->will( $this->returnValue( 'faketoken+\\' ) ); @@ -27,7 +28,7 @@ class TokenTest extends MediaWikiTestCase { } public function testToStringAtTimestamp() { - $token = \TestingAccessWrapper::newFromObject( new Token( 'sekret', 'salty', false ) ); + $token = TestingAccessWrapper::newFromObject( new Token( 'sekret', 'salty', false ) ); $this->assertSame( 'd9ade0c7d4349e9df9094e61c33a5a0d5644fde2+\\', @@ -53,7 +54,7 @@ class TokenTest extends MediaWikiTestCase { } public function testMatch() { - $token = \TestingAccessWrapper::newFromObject( new Token( 'sekret', 'salty', false ) ); + $token = TestingAccessWrapper::newFromObject( new Token( 'sekret', 'salty', false ) ); $test = $token->toStringAtTimestamp( time() - 10 ); $this->assertTrue( $token->match( $test ) );