[MediaWiki-commits] [Gerrit] Stop doing $that = $this in Client Tests - change (mediawiki...Wikibase)
Jeroen De Dauw has submitted this change and it was merged. Change subject: Stop doing $that = $this in Client Tests .. Stop doing $that = $this in Client Tests Closuers support $this as of 5.4 Change-Id: Ib003ca21e6d1554e1ce5bed4df8f1567db14ffb6 Depends-On: I68c5b5d60952418ff8300c163edfe2275571f41f --- M client/tests/phpunit/includes/DataAccess/PropertyParserFunction/StatementGroupRendererFactoryTest.php M client/tests/phpunit/includes/DataAccess/Scribunto/Scribunto_LuaWikibaseEntityLibraryTest.php M client/tests/phpunit/includes/DataAccess/Scribunto/Scribunto_LuaWikibaseLibraryTest.php M client/tests/phpunit/includes/Hooks/OtherProjectsSidebarGeneratorTest.php M client/tests/phpunit/includes/LangLinkHandlerTest.php M client/tests/phpunit/includes/UpdateRepo/UpdateRepoOnDeleteTest.php M client/tests/phpunit/includes/UpdateRepo/UpdateRepoOnMoveTest.php M client/tests/phpunit/includes/api/PageTermsTest.php 8 files changed, 25 insertions(+), 38 deletions(-) Approvals: Thiemo Mättig (WMDE): Looks good to me, approved jenkins-bot: Verified diff --git a/client/tests/phpunit/includes/DataAccess/PropertyParserFunction/StatementGroupRendererFactoryTest.php b/client/tests/phpunit/includes/DataAccess/PropertyParserFunction/StatementGroupRendererFactoryTest.php index 3bc40e4..e3fc738 100644 --- a/client/tests/phpunit/includes/DataAccess/PropertyParserFunction/StatementGroupRendererFactoryTest.php +++ b/client/tests/phpunit/includes/DataAccess/PropertyParserFunction/StatementGroupRendererFactoryTest.php @@ -149,16 +149,15 @@ $formatterFactory = $this->getMockBuilder( 'Wikibase\Lib\OutputFormatSnakFormatterFactory' ) ->disableOriginalConstructor() ->getMock(); - $self = $this; $formatterFactory->expects( $this->once() ) ->method( 'getSnakFormatter' ) ->will( $this->returnCallback( - function( $format, FormatterOptions $options ) use ( $self, $allowDataAccessInUserLanguage ) { - $self->assertSame( + function( $format, FormatterOptions $options ) use ( $allowDataAccessInUserLanguage ) { + $this->assertSame( $allowDataAccessInUserLanguage ? 'es' : 'de', $options->getOption( ValueFormatter::OPT_LANG ) ); - return $self->getMock( 'Wikibase\Lib\SnakFormatter' ); + return $this->getMock( 'Wikibase\Lib\SnakFormatter' ); } ) ); diff --git a/client/tests/phpunit/includes/DataAccess/Scribunto/Scribunto_LuaWikibaseEntityLibraryTest.php b/client/tests/phpunit/includes/DataAccess/Scribunto/Scribunto_LuaWikibaseEntityLibraryTest.php index 11bfc8f..508e34b 100644 --- a/client/tests/phpunit/includes/DataAccess/Scribunto/Scribunto_LuaWikibaseEntityLibraryTest.php +++ b/client/tests/phpunit/includes/DataAccess/Scribunto/Scribunto_LuaWikibaseEntityLibraryTest.php @@ -160,10 +160,9 @@ Parser::OT_HTML ); - $self = $this; // PHP 5.3 ... $parserOptions->registerWatcher( - function( $optionName ) use ( $self, &$cacheSplit ) { - $self->assertSame( 'userlang', $optionName ); + function( $optionName ) use ( &$cacheSplit ) { + $this->assertSame( 'userlang', $optionName ); $cacheSplit = true; } ); diff --git a/client/tests/phpunit/includes/DataAccess/Scribunto/Scribunto_LuaWikibaseLibraryTest.php b/client/tests/phpunit/includes/DataAccess/Scribunto/Scribunto_LuaWikibaseLibraryTest.php index 21582d4..2a3a9f6 100644 --- a/client/tests/phpunit/includes/DataAccess/Scribunto/Scribunto_LuaWikibaseLibraryTest.php +++ b/client/tests/phpunit/includes/DataAccess/Scribunto/Scribunto_LuaWikibaseLibraryTest.php @@ -319,10 +319,9 @@ Parser::OT_HTML ); - $self = $this; // PHP 5.3 ... $parserOptions->registerWatcher( - function( $optionName ) use ( $self, &$cacheSplit ) { - $self->assertSame( 'userlang', $optionName ); + function( $optionName ) use ( &$cacheSplit ) { + $this->assertSame( 'userlang', $optionName ); $cacheSplit = true; } ); diff --git a/client/tests/phpunit/includes/Hooks/OtherProjectsSidebarGeneratorTest.php
[MediaWiki-commits] [Gerrit] Stop doing $that = $this in Client Tests - change (mediawiki...Wikibase)
Addshore has uploaded a new change for review. https://gerrit.wikimedia.org/r/268555 Change subject: Stop doing $that = $this in Client Tests .. Stop doing $that = $this in Client Tests Closuers support $this as of 5.4 Change-Id: Ib003ca21e6d1554e1ce5bed4df8f1567db14ffb6 Depends-On: I68c5b5d60952418ff8300c163edfe2275571f41f --- M client/tests/phpunit/includes/DataAccess/PropertyParserFunction/StatementGroupRendererFactoryTest.php M client/tests/phpunit/includes/DataAccess/Scribunto/Scribunto_LuaWikibaseEntityLibraryTest.php M client/tests/phpunit/includes/DataAccess/Scribunto/Scribunto_LuaWikibaseLibraryTest.php M client/tests/phpunit/includes/Hooks/OtherProjectsSidebarGeneratorTest.php M client/tests/phpunit/includes/LangLinkHandlerTest.php M client/tests/phpunit/includes/UpdateRepo/UpdateRepoOnDeleteTest.php M client/tests/phpunit/includes/UpdateRepo/UpdateRepoOnMoveTest.php M client/tests/phpunit/includes/api/PageTermsTest.php 8 files changed, 25 insertions(+), 38 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/55/268555/1 diff --git a/client/tests/phpunit/includes/DataAccess/PropertyParserFunction/StatementGroupRendererFactoryTest.php b/client/tests/phpunit/includes/DataAccess/PropertyParserFunction/StatementGroupRendererFactoryTest.php index 3bc40e4..e3fc738 100644 --- a/client/tests/phpunit/includes/DataAccess/PropertyParserFunction/StatementGroupRendererFactoryTest.php +++ b/client/tests/phpunit/includes/DataAccess/PropertyParserFunction/StatementGroupRendererFactoryTest.php @@ -149,16 +149,15 @@ $formatterFactory = $this->getMockBuilder( 'Wikibase\Lib\OutputFormatSnakFormatterFactory' ) ->disableOriginalConstructor() ->getMock(); - $self = $this; $formatterFactory->expects( $this->once() ) ->method( 'getSnakFormatter' ) ->will( $this->returnCallback( - function( $format, FormatterOptions $options ) use ( $self, $allowDataAccessInUserLanguage ) { - $self->assertSame( + function( $format, FormatterOptions $options ) use ( $allowDataAccessInUserLanguage ) { + $this->assertSame( $allowDataAccessInUserLanguage ? 'es' : 'de', $options->getOption( ValueFormatter::OPT_LANG ) ); - return $self->getMock( 'Wikibase\Lib\SnakFormatter' ); + return $this->getMock( 'Wikibase\Lib\SnakFormatter' ); } ) ); diff --git a/client/tests/phpunit/includes/DataAccess/Scribunto/Scribunto_LuaWikibaseEntityLibraryTest.php b/client/tests/phpunit/includes/DataAccess/Scribunto/Scribunto_LuaWikibaseEntityLibraryTest.php index 11bfc8f..508e34b 100644 --- a/client/tests/phpunit/includes/DataAccess/Scribunto/Scribunto_LuaWikibaseEntityLibraryTest.php +++ b/client/tests/phpunit/includes/DataAccess/Scribunto/Scribunto_LuaWikibaseEntityLibraryTest.php @@ -160,10 +160,9 @@ Parser::OT_HTML ); - $self = $this; // PHP 5.3 ... $parserOptions->registerWatcher( - function( $optionName ) use ( $self, &$cacheSplit ) { - $self->assertSame( 'userlang', $optionName ); + function( $optionName ) use ( &$cacheSplit ) { + $this->assertSame( 'userlang', $optionName ); $cacheSplit = true; } ); diff --git a/client/tests/phpunit/includes/DataAccess/Scribunto/Scribunto_LuaWikibaseLibraryTest.php b/client/tests/phpunit/includes/DataAccess/Scribunto/Scribunto_LuaWikibaseLibraryTest.php index 21582d4..2a3a9f6 100644 --- a/client/tests/phpunit/includes/DataAccess/Scribunto/Scribunto_LuaWikibaseLibraryTest.php +++ b/client/tests/phpunit/includes/DataAccess/Scribunto/Scribunto_LuaWikibaseLibraryTest.php @@ -319,10 +319,9 @@ Parser::OT_HTML ); - $self = $this; // PHP 5.3 ... $parserOptions->registerWatcher( - function( $optionName ) use ( $self, &$cacheSplit ) { - $self->assertSame( 'userlang', $optionName ); + function( $optionName ) use ( &$cacheSplit ) { + $this->assertSame( 'userlang', $optionName ); $cacheSplit = true; } ); diff --git