jenkins-bot has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/363027 )
Change subject: Rename LexemeFormsView PHP class to FormsView
......................................................................
Rename LexemeFormsView PHP class to FormsView
The SensesView is already named like this, without repeating the word
"Lexeme". "Lexeme" is already in the namespace.
Change-Id: I469d620218cc609566c8d79ccc0e3a23e11f48ae
---
M src/DataModel/Serialization/LexemeDeserializer.php
R src/View/FormsView.php
M src/View/LexemeView.php
M src/View/LexemeViewFactory.php
M tests/phpunit/mediawiki/DataModel/Serialization/LexemeSerializerTest.php
R tests/phpunit/mediawiki/View/FormsViewTest.php
M tests/phpunit/mediawiki/View/LexemeViewTest.php
7 files changed, 22 insertions(+), 22 deletions(-)
Approvals:
Ladsgroup: Looks good to me, approved
jenkins-bot: Verified
Thiemo Mättig (WMDE): Looks good to me, but someone else must approve
diff --git a/src/DataModel/Serialization/LexemeDeserializer.php
b/src/DataModel/Serialization/LexemeDeserializer.php
index 7c4bb30..500b3cc 100644
--- a/src/DataModel/Serialization/LexemeDeserializer.php
+++ b/src/DataModel/Serialization/LexemeDeserializer.php
@@ -137,7 +137,7 @@
* @return Form[]
*/
private function deserializeForms( array $serialization ) {
- // TODO: Extract to a LexemeFormsDeserializer
+ // TODO: Extract to a FormsDeserializer
$forms = [];
if ( array_key_exists( 'forms', $serialization ) ) {
diff --git a/src/View/LexemeFormsView.php b/src/View/FormsView.php
similarity index 99%
rename from src/View/LexemeFormsView.php
rename to src/View/FormsView.php
index e9a088b..34af976 100644
--- a/src/View/LexemeFormsView.php
+++ b/src/View/FormsView.php
@@ -15,7 +15,7 @@
* @license GPL-2.0+
* @author Thiemo Mättig
*/
-class LexemeFormsView {
+class FormsView {
/**
* @var LocalizedTextProvider
diff --git a/src/View/LexemeView.php b/src/View/LexemeView.php
index 4ae5799..ef1c556 100644
--- a/src/View/LexemeView.php
+++ b/src/View/LexemeView.php
@@ -30,7 +30,7 @@
class LexemeView extends EntityView {
/**
- * @var LexemeFormsView
+ * @var FormsView
*/
private $formsView;
@@ -59,7 +59,7 @@
* @param EntityTermsView $entityTermsView
* @param LanguageDirectionalityLookup $languageDirectionalityLookup
* @param string $languageCode
- * @param LexemeFormsView $formsView
+ * @param FormsView $formsView
* @param SensesView $sensesView
* @param StatementSectionsView $statementSectionsView
* @param HtmlTermRenderer $htmlTermRenderer
@@ -70,7 +70,7 @@
EntityTermsView $entityTermsView,
LanguageDirectionalityLookup $languageDirectionalityLookup,
$languageCode,
- LexemeFormsView $formsView,
+ FormsView $formsView,
SensesView $sensesView,
StatementSectionsView $statementSectionsView,
HtmlTermRenderer $htmlTermRenderer,
diff --git a/src/View/LexemeViewFactory.php b/src/View/LexemeViewFactory.php
index b8c6536..64ffab6 100644
--- a/src/View/LexemeViewFactory.php
+++ b/src/View/LexemeViewFactory.php
@@ -110,7 +110,7 @@
->getLanguageFallbackLabelDescriptionLookupFactory()
->newLabelDescriptionLookup( Language::factory(
$this->languageCode ) );
- $formsView = new LexemeFormsView(
+ $formsView = new FormsView(
$localizedTextProvider,
$templateFactory,
$this->entityIdHtmlLinkFormatterFactory
diff --git
a/tests/phpunit/mediawiki/DataModel/Serialization/LexemeSerializerTest.php
b/tests/phpunit/mediawiki/DataModel/Serialization/LexemeSerializerTest.php
index a1cbc2f..c24e0b7 100644
--- a/tests/phpunit/mediawiki/DataModel/Serialization/LexemeSerializerTest.php
+++ b/tests/phpunit/mediawiki/DataModel/Serialization/LexemeSerializerTest.php
@@ -178,7 +178,7 @@
);
}
- public function
testLexemeFormWithRepresentation_SerializesFromRepresentation() {
+ public function
testFormWithRepresentation_SerializesFromRepresentation() {
$lexeme = NewLexeme::havingForm(
NewForm::havingRepresentation( 'en', 'some
representation' )
)->build();
@@ -195,7 +195,7 @@
);
}
- public function testSerializesStatementsOnLexemeForms() {
+ public function testSerializesStatementsOnForms() {
$lexeme = NewLexeme::havingForm(
NewForm::havingStatement( NewStatement::forProperty(
"P2" ) )
)->build();
@@ -207,7 +207,7 @@
hasKeyValuePair( "claims", equalTo( "P2" ) ) )
) );
}
- public function testSerializeGrammaticalFeaturesOnLexemeForms() {
+ public function testSerializeGrammaticalFeaturesOnForms() {
$lexeme = NewLexeme::havingForm(
NewForm::havingGrammaticalFeature( 'Q1' )
)->build();
diff --git a/tests/phpunit/mediawiki/View/LexemeFormsViewTest.php
b/tests/phpunit/mediawiki/View/FormsViewTest.php
similarity index 95%
rename from tests/phpunit/mediawiki/View/LexemeFormsViewTest.php
rename to tests/phpunit/mediawiki/View/FormsViewTest.php
index 3a80a4b..00f57a3 100644
--- a/tests/phpunit/mediawiki/View/LexemeFormsViewTest.php
+++ b/tests/phpunit/mediawiki/View/FormsViewTest.php
@@ -6,7 +6,7 @@
use Prophecy\Argument;
use Wikibase\DataModel\Services\Lookup\LabelDescriptionLookup;
use Wikibase\Lexeme\Tests\DataModel\NewForm;
-use Wikibase\Lexeme\View\LexemeFormsView;
+use Wikibase\Lexeme\View\FormsView;
use Wikibase\Lexeme\View\Template\LexemeTemplateFactory;
use Wikibase\Lib\EntityIdHtmlLinkFormatter;
use Wikibase\Lib\LanguageNameLookup;
@@ -15,14 +15,14 @@
use Wikibase\View\StatementGroupListView;
/**
- * @covers Wikibase\Lexeme\View\LexemeFormsView
+ * @covers Wikibase\Lexeme\View\FormsView
*
* @group WikibaseLexeme
*
* @license GPL-2.0+
* @author Thiemo Mättig
*/
-class LexemeFormsViewTest extends PHPUnit_Framework_TestCase {
+class FormsViewTest extends PHPUnit_Framework_TestCase {
const STATEMENT_LIST_HTML = '<div class="statement-list"></div>';
@@ -123,7 +123,7 @@
$statementSectionView = $this->prophesize(
StatementGroupListView::class );
$statementSectionView->getHtml( Argument::any() )->willReturn(
self::STATEMENT_LIST_HTML );
- return new LexemeFormsView(
+ return new FormsView(
new DummyLocalizedTextProvider(),
new LexemeTemplateFactory( [
'wikibase-lexeme-form' => '
diff --git a/tests/phpunit/mediawiki/View/LexemeViewTest.php
b/tests/phpunit/mediawiki/View/LexemeViewTest.php
index 87c7821..3990301 100644
--- a/tests/phpunit/mediawiki/View/LexemeViewTest.php
+++ b/tests/phpunit/mediawiki/View/LexemeViewTest.php
@@ -14,7 +14,7 @@
use Wikibase\DataModel\Term\Term;
use Wikibase\Lexeme\DataModel\Lexeme;
use Wikibase\Lexeme\DataModel\LexemeId;
-use Wikibase\Lexeme\View\LexemeFormsView;
+use Wikibase\Lexeme\View\FormsView;
use Wikibase\Lexeme\View\SensesView;
use Wikibase\Lexeme\View\LexemeView;
use Wikibase\Lib\LanguageNameLookup;
@@ -38,15 +38,15 @@
class LexemeViewTest extends PHPUnit_Framework_TestCase {
/**
- * @return LexemeFormsView
+ * @return FormsView
*/
private function newFormsViewMock() {
- $view = $this->getMockBuilder( LexemeFormsView::class )
+ $view = $this->getMockBuilder( FormsView::class )
->disableOriginalConstructor()
->getMock();
$view->method( 'getHtml' )
- ->will( $this->returnValue(
"lexemeFormsView->getHtml\n" ) );
+ ->will( $this->returnValue( "FormsView::getHtml\n" ) );
return $view;
}
@@ -78,7 +78,7 @@
$statementSectionsView->expects( $expectedStatements ?
$this->once() : $this->never() )
->method( 'getHtml' )
->with( $expectedStatements )
- ->will( $this->returnValue(
"statementSectionsView->getHtml\n" ) );
+ ->will( $this->returnValue(
"StatementSectionsView::getHtml\n" ) );
return $statementSectionsView;
}
@@ -176,9 +176,9 @@
$this->assertInternalType( 'string', $html );
$this->assertContains( 'id="wb-lexeme-' . ( $lexeme->getId() ?:
'new' ) . '"', $html );
$this->assertContains( 'class="wikibase-entityview wb-lexeme"',
$html );
- $this->assertContains( 'lexemeFormsView->getHtml', $html );
+ $this->assertContains( 'FormsView::getHtml', $html );
$this->assertContains( 'SensesView::getHtml', $html );
- $this->assertContains( 'statementSectionsView->getHtml', $html
);
+ $this->assertContains( 'StatementSectionsView::getHtml', $html
);
}
public function provideTestGetHtml() {
@@ -247,8 +247,8 @@
);
$this->assertContains(
'<div id="toc"></div>'
- . "statementSectionsView->getHtml\n"
- . "lexemeFormsView->getHtml\n"
+ . "StatementSectionsView::getHtml\n"
+ . "FormsView::getHtml\n"
. "SensesView::getHtml\n"
. '</div>',
$html
--
To view, visit https://gerrit.wikimedia.org/r/363027
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I469d620218cc609566c8d79ccc0e3a23e11f48ae
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/WikibaseLexeme
Gerrit-Branch: master
Gerrit-Owner: Thiemo Mättig (WMDE) <[email protected]>
Gerrit-Reviewer: Aleksey Bekh-Ivanov (WMDE) <[email protected]>
Gerrit-Reviewer: Jakob <[email protected]>
Gerrit-Reviewer: Jonas Kress (WMDE) <[email protected]>
Gerrit-Reviewer: Ladsgroup <[email protected]>
Gerrit-Reviewer: Maintenance-bot <[email protected]>
Gerrit-Reviewer: Thiemo Mättig (WMDE) <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits