Addshore has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/78517


Change subject: Add basic tests for special pages missing them
......................................................................

Add basic tests for special pages missing them

Change-Id: Ib0baec4cc05ebb921708f721fd25bc775b693963
---
A repo/tests/phpunit/includes/specials/SpecialEntitiesWithoutLabelTest.php
A repo/tests/phpunit/includes/specials/SpecialItemsWithoutSitelinksTest.php
A repo/tests/phpunit/includes/specials/SpecialListDatatypesTest.php
3 files changed, 162 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/17/78517/1

diff --git 
a/repo/tests/phpunit/includes/specials/SpecialEntitiesWithoutLabelTest.php 
b/repo/tests/phpunit/includes/specials/SpecialEntitiesWithoutLabelTest.php
new file mode 100644
index 0000000..f570b99
--- /dev/null
+++ b/repo/tests/phpunit/includes/specials/SpecialEntitiesWithoutLabelTest.php
@@ -0,0 +1,54 @@
+<?php
+
+namespace Wikibase\Test;
+use SpecialEntitiesWithoutLabel;
+
+/**
+ * Tests for the SpecialEntitiesWithoutLabel 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 Adam Shorland
+ */
+class SpecialEntitiesWithoutLabelTest extends SpecialPageTestBase {
+
+       protected function newSpecialPage() {
+               return new SpecialEntitiesWithoutLabel();
+       }
+
+       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' );
+       }
+
+}
\ No newline at end of file
diff --git 
a/repo/tests/phpunit/includes/specials/SpecialItemsWithoutSitelinksTest.php 
b/repo/tests/phpunit/includes/specials/SpecialItemsWithoutSitelinksTest.php
new file mode 100644
index 0000000..4328069
--- /dev/null
+++ b/repo/tests/phpunit/includes/specials/SpecialItemsWithoutSitelinksTest.php
@@ -0,0 +1,54 @@
+<?php
+
+namespace Wikibase\Test;
+use SpecialItemsWithoutSitelinks;
+
+/**
+ * Tests for the SpecialItemsWithoutSitelinks 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 Adam Shorland
+ */
+class SpecialItemsWithoutSitelinksTest extends SpecialPageTestBase {
+
+       protected function newSpecialPage() {
+               return new SpecialItemsWithoutSitelinks();
+       }
+
+       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' );
+       }
+
+}
\ No newline at end of file
diff --git a/repo/tests/phpunit/includes/specials/SpecialListDatatypesTest.php 
b/repo/tests/phpunit/includes/specials/SpecialListDatatypesTest.php
new file mode 100644
index 0000000..487cdb6
--- /dev/null
+++ b/repo/tests/phpunit/includes/specials/SpecialListDatatypesTest.php
@@ -0,0 +1,54 @@
+<?php
+
+namespace Wikibase\Test;
+use SpecialListDatatypes;
+
+/**
+ * Tests for the SpecialListDataTypes 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 Adam Shorland
+ */
+class SpecialListDataTypesTest extends SpecialPageTestBase {
+
+       protected function newSpecialPage() {
+               return new SpecialListDataTypes();
+       }
+
+       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' );
+       }
+
+}
\ No newline at end of file

-- 
To view, visit https://gerrit.wikimedia.org/r/78517
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib0baec4cc05ebb921708f721fd25bc775b693963
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Addshore <[email protected]>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to