jenkins-bot has submitted this change and it was merged.
Change subject: Special page for entities without description
......................................................................
Special page for entities without description
New base class SpecialEntitiesWithoutPage and subpages
SpecialEntitiesWithoutLabel and SpecialEntitiesWithoutDescription
Bug: 42102
Change-Id: I16570b0844653c9e8a2fb1e75c2efa72b586d5d5
---
M repo/Wikibase.classes.php
M repo/Wikibase.i18n.alias.php
M repo/Wikibase.i18n.php
M repo/Wikibase.php
A repo/includes/specials/SpecialEntitiesWithoutDescription.php
M repo/includes/specials/SpecialEntitiesWithoutLabel.php
A repo/includes/specials/SpecialEntitiesWithoutPage.php
A repo/tests/phpunit/includes/specials/SpecialEntitiesWithoutDescriptionTest.php
8 files changed, 410 insertions(+), 163 deletions(-)
Approvals:
Addshore: Looks good to me, approved
jenkins-bot: Verified
diff --git a/repo/Wikibase.classes.php b/repo/Wikibase.classes.php
index 272a82a..cd41d0d 100644
--- a/repo/Wikibase.classes.php
+++ b/repo/Wikibase.classes.php
@@ -126,7 +126,9 @@
'SpecialSetDescription' =>
'includes/specials/SpecialSetDescription.php',
'SpecialSetAliases' =>
'includes/specials/SpecialSetAliases.php',
'SpecialSetSiteLink' =>
'includes/specials/SpecialSetSiteLink.php',
+ 'SpecialEntitiesWithoutPage' =>
'includes/specials/SpecialEntitiesWithoutPage.php',
'SpecialEntitiesWithoutLabel' =>
'includes/specials/SpecialEntitiesWithoutLabel.php',
+ 'SpecialEntitiesWithoutDescription' =>
'includes/specials/SpecialEntitiesWithoutDescription.php',
'SpecialItemsWithoutSitelinks' =>
'includes/specials/SpecialItemsWithoutSitelinks.php',
'SpecialListDatatypes' =>
'includes/specials/SpecialListDatatypes.php',
'SpecialDispatchStats' =>
'includes/specials/SpecialDispatchStats.php',
diff --git a/repo/Wikibase.i18n.alias.php b/repo/Wikibase.i18n.alias.php
index 13d8630..cb60c3d 100644
--- a/repo/Wikibase.i18n.alias.php
+++ b/repo/Wikibase.i18n.alias.php
@@ -28,6 +28,7 @@
'SetAliases' => array( 'SetAliases' ),
'SetSiteLink' => array( 'SetSiteLink' ),
'EntitiesWithoutLabel' => array( 'EntitiesWithoutLabel' ),
+ 'EntitiesWithoutDescription' => array( 'EntitiesWithoutDescription' ),
'ItemsWithoutSitelinks' => array( 'ItemsWithoutSitelinks' ),
'MyLanguageFallbackChain' => array( 'MyLanguageFallbackChain' ),
);
@@ -84,6 +85,7 @@
'SetAliases' => array( 'Aliasse_festlegen' ),
'SetSiteLink' => array( 'Websitelink_festlegen' ),
'EntitiesWithoutLabel' => array( 'Objekte_ohne_Bezeichnung' ),
+ 'EntitiesWithoutDescription' => array( 'Objekte_ohne_Beschreibung' ),
'ItemsWithoutSitelinks' => array( 'Objekte_ohne_Websitelinks' ),
'MyLanguageFallbackChain' => array( 'Meine_Sprachfallbackkette' ),
);
@@ -300,4 +302,4 @@
'SetAliases' => array( '設置別名' ),
'EntitiesWithoutLabel' => array( '沒有標籤的實體' ),
'ItemsWithoutSitelinks' => array( '沒有條目連結的項目' ),
-);
\ No newline at end of file
+);
diff --git a/repo/Wikibase.i18n.php b/repo/Wikibase.i18n.php
index 96e0629..1bc6d7f 100644
--- a/repo/Wikibase.i18n.php
+++ b/repo/Wikibase.i18n.php
@@ -211,6 +211,8 @@
'wikibase-listdatatypes-intro' => 'This is a list of all datatypes
currently in use on this installation:',
'wikibase-history-title-with-label' => 'Revision history of "$2" ($1)',
'wikibase-history-title-without-label' => 'Revision history of ($1)',
+ 'special-entitieswithoutdescription' => 'Entities without description',
+ 'wikibase-entitieswithoutdescription-legend' => 'Get list of entities
without description',
'special-entitieswithoutlabel' => 'Entities without label',
'wikibase-entitieswithoutlabel-legend' => 'Get list of entities without
label',
'wikibase-entitieswithoutlabel-label-language' => 'Language:',
@@ -868,6 +870,9 @@
* $2 - the localized label, it is usually in quotes',
'wikibase-history-title-without-label' => 'The title of the history
page with only a prefixed id. Parameters:
* $1 - the prefixed id, the id is usually in parenthesis',
+ 'special-entitieswithoutdescription' =>
'{{doc-special|EntitiesWithoutDescription}}
+This special page returns a list of entities without description for a given
language',
+ 'wikibase-entitieswithoutdescription-legend' => 'Legend of the form
that allow to change the language.',
'special-entitieswithoutlabel' => '{{doc-special|EntitiesWithoutLabel}}
This special page returns a list of entities without label for a given
language',
'wikibase-entitieswithoutlabel-legend' => 'Legend of the form that
allow to change the language.',
diff --git a/repo/Wikibase.php b/repo/Wikibase.php
index a208162..6dcca9a 100644
--- a/repo/Wikibase.php
+++ b/repo/Wikibase.php
@@ -133,7 +133,7 @@
$wgSpecialPages['SetAliases']
= 'SpecialSetAliases';
$wgSpecialPages['SetSiteLink']
= 'SpecialSetSiteLink';
$wgSpecialPages['EntitiesWithoutLabel'] =
'SpecialEntitiesWithoutLabel';
- $wgSpecialPages['NewProperty']
= 'SpecialNewProperty';
+ $wgSpecialPages['EntitiesWithoutDescription'] =
'SpecialEntitiesWithoutDescription';
$wgSpecialPages['ListDatatypes']
= 'SpecialListDatatypes';
$wgSpecialPages['DispatchStats']
= 'SpecialDispatchStats';
$wgSpecialPages['EntityData']
= 'SpecialEntityData';
@@ -150,10 +150,11 @@
$wgSpecialPageGroups['SetAliases']
= 'wikibaserepo';
$wgSpecialPageGroups['SetSiteLink']
= 'wikibaserepo';
$wgSpecialPageGroups['EntitiesWithoutLabel'] =
'wikibaserepo';
- $wgSpecialPageGroups['EntityData']
= 'wikibaserepo';
+ $wgSpecialPageGroups['EntitiesWithoutDescription'] =
'wikibaserepo';
$wgSpecialPageGroups['ListDatatypes'] =
'wikibaserepo';
$wgSpecialPageGroups['DispatchStats'] =
'wikibaserepo';
- $wgSpecialPageGroups['MyLanguageFallbackChain']
= 'wikibaserepo';
+ $wgSpecialPageGroups['EntityData']
= 'wikibaserepo';
+ $wgSpecialPageGroups['MyLanguageFallbackChain'] =
'wikibaserepo';
// Hooks
$wgHooks['BeforePageDisplay'][]
= 'Wikibase\RepoHooks::onBeforePageDisplay';
diff --git a/repo/includes/specials/SpecialEntitiesWithoutDescription.php
b/repo/includes/specials/SpecialEntitiesWithoutDescription.php
new file mode 100644
index 0000000..041e428
--- /dev/null
+++ b/repo/includes/specials/SpecialEntitiesWithoutDescription.php
@@ -0,0 +1,56 @@
+<?php
+
+/**
+ * Page for listing entities without description.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ * @since 0.4
+ *
+ * @file
+ * @ingroup WikibaseRepo
+ *
+ * @licence GNU GPL v2+
+ * @author Bene*
+ */
+class SpecialEntitiesWithoutDescription extends SpecialEntitiesWithoutPage {
+
+ public function __construct() {
+ parent::__construct( 'EntitiesWithoutDescription' );
+ }
+
+ /**
+ * @see SpecialEntitiesWithoutPage::getTermType
+ *
+ * @since 0.4
+ *
+ * @return string
+ */
+ protected function getTermType() {
+ return \Wikibase\Term::TYPE_DESCRIPTION;
+ }
+
+ /**
+ * @see SpecialEntitiesWithoutPage::getLegend
+ *
+ * @since 0.4
+ *
+ * @return string
+ */
+ protected function getLegend() {
+ return $this->msg( 'wikibase-entitieswithoutdescription-legend'
)->text();
+ }
+}
diff --git a/repo/includes/specials/SpecialEntitiesWithoutLabel.php
b/repo/includes/specials/SpecialEntitiesWithoutLabel.php
index ab104ee..cc8ddff 100644
--- a/repo/includes/specials/SpecialEntitiesWithoutLabel.php
+++ b/repo/includes/specials/SpecialEntitiesWithoutLabel.php
@@ -1,7 +1,5 @@
<?php
-use Wikibase\EntityId;
-
/**
* Page for listing entities without label.
*
@@ -26,178 +24,33 @@
* @ingroup WikibaseRepo
*
* @licence GNU GPL v2+
- * @author Thomas Pellissier Tanon
+ * @author Bene*
*/
-class SpecialEntitiesWithoutLabel extends SpecialWikibaseQueryPage {
-
- /**
- * The language used
- *
- * @since 0.2
- *
- * @var string
- */
- protected $language = '';
+class SpecialEntitiesWithoutLabel extends SpecialEntitiesWithoutPage {
public function __construct() {
parent::__construct( 'EntitiesWithoutLabel' );
-
}
/**
- * @see SpecialWikibasePage::execute
+ * @see SpecialEntitiesWithoutPage::getTermType
*
- * @since 0.2
+ * @since 0.4
*
- * @param string $subPage
- * @return boolean
+ * @return string
*/
- public function execute( $subPage ) {
- if ( !parent::execute( $subPage ) ) {
- return false;
- }
-
- # 10 seconds server-side caching max
- $this->getOutput()->setSquidMaxage( 10 );
-
- $output = $this->getOutput();
- $request = $this->getRequest();
-
- $this->language = '';
- $this->type = null;
- if ( $subPage !== null ) {
- $parts = explode( '/', $subPage );
- if ( array_key_exists( 1, $parts ) ) {
- $this->type = $parts[1];
- }
- $this->language = $parts[0];
- }
-
- $this->language = $request->getText( 'language',
$this->language );
- if ( $this->language !== '' && !in_array( $this->language,
\Wikibase\Utils::getLanguageCodes() ) ) {
- $output->addWikiMsg(
'wikibase-entitieswithoutlabel-invalid-language', $this->language );
- $this->language = '';
- }
-
- $this->type = $request->getText( 'type', $this->type );
- $possibleTypes = array( 'item', 'property', 'query' );
- if ( $this->type === '' ) {
- $this->type = null;
- }
- if ( $this->type !== null && !in_array( $this->type,
$possibleTypes ) ) {
- $output->addWikiMsg(
'wikibase-entitieswithoutlabel-invalid-type', $this->type );
- $this->type = null;
- }
- $typeSelect = new XmlSelect( 'type',
'wb-entitieswithoutlabel-type', $this->type );
- $typeSelect->addOption( $this->msg(
'wikibase-entitieswithoutlabel-label-alltypes' )->text(), '' );
- // Give grep a chance to find the usages:
- // wikibase-entity-item, wikibase-entity-property,
wikibase-entity-query
- foreach( $possibleTypes as $possibleType ) {
- $typeSelect->addOption( $this->msg( 'wikibase-entity-'
. $possibleType )->text(), $possibleType );
- }
-
- $output->addHTML(
- Html::openElement(
- 'form',
- array(
- 'action' =>
$this->getTitle()->getLocalURL(),
- 'name' => 'entitieswithoutlabel',
- 'id' => 'wb-entitieswithoutlabel-form'
- )
- ) .
- Html::openElement( 'fieldset' ) .
- Html::element(
- 'legend',
- array(),
- $this->msg(
'wikibase-entitieswithoutlabel-legend' )->text()
- ) .
- Html::openElement( 'p' ) .
- Html::element(
- 'label',
- array(
- 'for' =>
'wb-entitieswithoutlabel-language'
- ),
- $this->msg(
'wikibase-entitieswithoutlabel-label-language' )->text()
- ) . ' ' .
- Html::input(
- 'language',
- $this->language,
- 'text',
- array(
- 'id' =>
'wb-entitieswithoutlabel-language'
- )
- ) . ' ' .
- Html::element(
- 'label',
- array(
- 'for' => 'wb-entitieswithoutlabel-type'
- ),
- $this->msg(
'wikibase-entitieswithoutlabel-label-type' )->text()
- ) . ' ' .
- $typeSelect->getHTML() . ' ' .
- Html::input(
- 'submit',
- $this->msg(
'wikibase-entitieswithoutlabel-submit' )->text(),
- 'submit',
- array(
- 'id' =>
'wikibase-entitieswithoutlabel-submit',
- 'class' => 'wb-input-button'
- )
- ) .
- Html::closeElement( 'p' ) .
- Html::closeElement( 'fieldset' ) .
- Html::closeElement( 'form' )
- );
-
- if ( $this->language !== '' ) {
- $this->showQuery();
- }
+ protected function getTermType() {
+ return \Wikibase\Term::TYPE_LABEL;
}
/**
- * @see SpecialWikibaseQueryPage::formatRow
+ * @see SpecialEntitiesWithoutPage::getLegend
*
- * @since 0.3
+ * @since 0.4
*
- * @param $entry The entry is for this call an EntityId
- *
- * @return string|null
+ * @return string
*/
- protected function formatRow( $entry ) {
- try {
- $title =
\Wikibase\EntityContentFactory::singleton()->getTitleForId( $entry );
- return Linker::linkKnown( $title );
- } catch ( MWException $e ) {
- wfWarn( "Error formatting result row: " .
$e->getMessage() );
- return false;
- }
+ protected function getLegend() {
+ return $this->msg( 'wikibase-entitieswithoutlabel-legend'
)->text();
}
-
- /**
- * @see SpecialWikibaseQueryPage::getResult
- *
- * @since 0.2
- *
- * @param integer $offset
- * @param integer $limit
- *
- * @return EntityId[]
- */
- protected function getResult( $offset = 0, $limit = 0 ) {
- $entityPerPage = \Wikibase\StoreFactory::getStore( 'sqlstore'
)->newEntityPerPage();
- return $entityPerPage->getEntitiesWithoutTerm(
\Wikibase\Term::TYPE_LABEL, $this->language, $this->type, $limit, $offset );
- }
-
-
- /**
- * @see SpecialWikibaseQueryPage::getTitleForNavigation
- *
- * @since 0.2
- *
- * @return Title
- */
- protected function getTitleForNavigation() {
- return $this->getTitle( $this->language . '/' . $this->type );
- }
-
}
diff --git a/repo/includes/specials/SpecialEntitiesWithoutPage.php
b/repo/includes/specials/SpecialEntitiesWithoutPage.php
new file mode 100644
index 0000000..bcdc4b4
--- /dev/null
+++ b/repo/includes/specials/SpecialEntitiesWithoutPage.php
@@ -0,0 +1,272 @@
+<?php
+
+/**
+ * Base page for pages listing entities without a specific value.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ * @since 0.4
+ *
+ * @file
+ * @ingroup WikibaseRepo
+ *
+ * @licence GNU GPL v2+
+ * @author Thomas Pellissier Tanon
+ * @author Bene*
+ */
+abstract class SpecialEntitiesWithoutPage extends SpecialWikibaseQueryPage {
+
+ /**
+ * The language used
+ *
+ * @since 0.4
+ *
+ * @var string
+ */
+ protected $language = '';
+
+ /**
+ * The type used
+ *
+ * @since 0.4
+ *
+ * @var string
+ */
+ protected $type = null;
+
+ /**
+ * Map entity types to objects representing the corresponding entity
+ *
+ * @since 0.4
+ *
+ * @var array
+ */
+ protected $possibleTypes;
+
+ /**
+ * @see SpecialWikibasePage::execute
+ *
+ * @since 0.4
+ *
+ * @param string $subPage
+ *
+ * @return boolean
+ */
+ public function execute( $subPage ) {
+ if ( !parent::execute( $subPage ) ) {
+ return false;
+ }
+
+ // 10 seconds server-side caching max
+ $this->getOutput()->setSquidMaxage( 10 );
+
+ $this->prepareArguments( $subPage );
+
+ $this->setForm();
+
+ if ( $this->language !== '' ) {
+ $this->showQuery();
+ }
+ }
+
+ /**
+ * Prepare the arguments
+ *
+ * @since 0.4
+ *
+ * @param string $subPage
+ */
+ private function prepareArguments( $subPage ) {
+ $request = $this->getRequest();
+ $output = $this->getOutput();
+
+ $this->language = '';
+ $this->type = null;
+ if ( $subPage !== null ) {
+ $parts = explode( '/', $subPage );
+ if ( isset( $parts[1] ) ) {
+ $this->type = $parts[1];
+ }
+ $this->language = $parts[0];
+ }
+
+ $this->language = $request->getText( 'language',
$this->language );
+ if ( $this->language !== '' && !in_array( $this->language,
\Wikibase\Utils::getLanguageCodes() ) ) {
+ $this->showErrorHTML( $this->msg(
'wikibase-entitieswithoutlabel-invalid-language', $this->language )->parse() );
+ $this->language = '';
+ }
+
+ $this->type = $request->getText( 'type', $this->type );
+ $this->possibleTypes =
\Wikibase\EntityFactory::singleton()->getEntityTypes();
+ if ( $this->type === '' ) {
+ $this->type = null;
+ }
+ if ( $this->type !== null && !in_array( $this->type,
$this->possibleTypes ) ) {
+ $this->showErrorHTML( $this->msg(
'wikibase-entitieswithoutlabel-invalid-type', $this->type )->parse() );
+ $this->type = null;
+ }
+ }
+
+ /**
+ * Show an error
+ *
+ * @since 0.4
+ *
+ * @param string $error The error message in HTML format
+ * @param string $class The element's class, default 'error'
+ */
+ private function showErrorHTML( $error, $class = 'error' ) {
+ $this->getOutput()->addHTML(
+ Html::rawElement(
+ 'p',
+ array( 'class' => $class ),
+ $error
+ )
+ );
+ }
+
+ /**
+ * Build the HTML form
+ *
+ * @since 0.4
+ */
+ private function setForm() {
+ $typeSelect = new XmlSelect( 'type',
'wb-entitieswithoutpage-type', $this->type );
+ $typeSelect->addOption( $this->msg(
'wikibase-entitieswithoutlabel-label-alltypes' )->text(), '' );
+ // item, property and query
+ foreach( $this->possibleTypes as $type ) {
+ $typeSelect->addOption( $this->msg( 'wikibase-entity-'
. $type )->text(), $type );
+ }
+
+ $this->getOutput()->addHTML(
+ Html::openElement(
+ 'form',
+ array(
+ 'action' =>
$this->getTitle()->getLocalURL(),
+ 'name' => 'entitieswithoutpage',
+ 'id' => 'wb-entitieswithoutpage-form'
+ )
+ ) .
+ Html::openElement( 'fieldset' ) .
+ Html::element(
+ 'legend',
+ array(),
+ $this->getLegend()
+ ) .
+ Html::openElement( 'p' ) .
+ Html::element(
+ 'label',
+ array(
+ 'for' =>
'wb-entitieswithoutpage-language'
+ ),
+ $this->msg(
'wikibase-entitieswithoutlabel-label-language' )->text()
+ ) . ' ' .
+ Html::input(
+ 'language',
+ $this->language,
+ 'text',
+ array(
+ 'id' =>
'wb-entitieswithoutpage-language'
+ )
+ ) . ' ' .
+ Html::element(
+ 'label',
+ array(
+ 'for' => 'wb-entitieswithoutpage-type'
+ ),
+ $this->msg(
'wikibase-entitieswithoutlabel-label-type' )->text()
+ ) . ' ' .
+ $typeSelect->getHTML() . ' ' .
+ Html::input(
+ 'submit',
+ $this->msg(
'wikibase-entitieswithoutlabel-submit' )->text(),
+ 'submit',
+ array(
+ 'id' =>
'wikibase-entitieswithoutpage-submit',
+ 'class' => 'wb-input-button'
+ )
+ ) .
+ Html::closeElement( 'p' ) .
+ Html::closeElement( 'fieldset' ) .
+ Html::closeElement( 'form' )
+ );
+ }
+
+ /**
+ * @see SpecialWikibaseQueryPage::formatRow
+ *
+ * @since 0.3
+ *
+ * @param $entry The entry is for this call an EntityId
+ *
+ * @return string|null
+ */
+ protected function formatRow( $entry ) {
+ try {
+ $title =
\Wikibase\EntityContentFactory::singleton()->getTitleForId( $entry );
+ return Linker::linkKnown( $title );
+ } catch ( MWException $e ) {
+ wfWarn( "Error formatting result row: " .
$e->getMessage() );
+ return false;
+ }
+ }
+
+ /**
+ * @see SpecialWikibaseQueryPage::getResult
+ *
+ * @since 0.4
+ *
+ * @param integer $offset
+ * @param integer $limit
+ *
+ * @return EntityId[]
+ */
+ protected function getResult( $offset = 0, $limit = 0 ) {
+ $entityPerPage = \Wikibase\StoreFactory::getStore( 'sqlstore'
)->newEntityPerPage();
+ return $entityPerPage->getEntitiesWithoutTerm(
$this->getTermType(), $this->language, $this->type, $limit, $offset );
+ }
+
+
+ /**
+ * @see SpecialWikibaseQueryPage::getTitleForNavigation
+ *
+ * @since 0.4
+ *
+ * @return Title
+ */
+ protected function getTitleForNavigation() {
+ return $this->getTitle( $this->language . '/' . $this->type );
+ }
+
+ /**
+ * Get the term type (member of Term::TYPE_ enum)
+ *
+ * @since 0.4
+ *
+ * @return string
+ */
+ protected abstract function getTermType();
+
+ /**
+ * Get the legend in HTML format
+ *
+ * @since 0.4
+ *
+ * @return string
+ */
+ protected abstract function getLegend();
+
+}
diff --git
a/repo/tests/phpunit/includes/specials/SpecialEntitiesWithoutDescriptionTest.php
b/repo/tests/phpunit/includes/specials/SpecialEntitiesWithoutDescriptionTest.php
new file mode 100644
index 0000000..0d84539
--- /dev/null
+++
b/repo/tests/phpunit/includes/specials/SpecialEntitiesWithoutDescriptionTest.php
@@ -0,0 +1,56 @@
+<?php
+
+namespace Wikibase\Test;
+
+/**
+ * Tests for the SpecialEntitiesWithoutDescription class.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ * @file
+ * @since 0.4
+ *
+ * @ingroup WikibaseRepoTest
+ * @ingroup Test
+ *
+ * @group Wikibase
+ * @group SpecialPage
+ * @group WikibaseSpecialPage
+ *
+ * @licence GNU GPL v2+
+ * @author Bene* < [email protected] >
+ */
+class SpecialEntitiesWithoutDescriptionTest extends SpecialPageTestBase {
+
+ protected function newSpecialPage() {
+ return new \SpecialEntitiesWithoutDescription();
+ }
+
+ public function testExecute() {
+ //TODO: Actually verify that the output is correct.
+ // Currently this just tests that there is no fatal error,
+ // and that the restriction handling is working and doesn't
+ // block. That is, the default should let the user execute
+ // the page.
+
+ list( $output, ) = $this->executeSpecialPage( '' );
+ $this->assertTrue( true, 'Calling execute without any subpage
value' );
+
+ list( $output, ) = $this->executeSpecialPage( 'en' );
+ $this->assertTrue( true, 'Calling execute with a subpage value'
); //TODO: assert output
+ }
+
+}
\ No newline at end of file
--
To view, visit https://gerrit.wikimedia.org/r/67634
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I16570b0844653c9e8a2fb1e75c2efa72b586d5d5
Gerrit-PatchSet: 19
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Bene <[email protected]>
Gerrit-Reviewer: Addshore <[email protected]>
Gerrit-Reviewer: Aude <[email protected]>
Gerrit-Reviewer: Bene <[email protected]>
Gerrit-Reviewer: Daniel Kinzler <[email protected]>
Gerrit-Reviewer: Hoo man <[email protected]>
Gerrit-Reviewer: Jeroen De Dauw <[email protected]>
Gerrit-Reviewer: Reedy <[email protected]>
Gerrit-Reviewer: Tobias Gritschacher <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits