jenkins-bot has submitted this change and it was merged.

Change subject: (Bug 33181) Special:Concepts to list available concepts
......................................................................


(Bug 33181) Special:Concepts to list available concepts

I got relentlessly tiered of searching for existing concepts therefore
this Special:Concepts should solve the issue.

* Fix "Use of Linker::makeLinkObj was deprecated in MediaWiki 1.21" in
SMW_DV_WikiPage.php:287 due to the complained of PHPunit.

Test coverage: 100%
CRAP: 6

Change-Id: I4901a2814e9e9c514dbd2b5abf4be74002319f6e
---
M SemanticMediaWiki.hooks.php
M includes/Setup.php
M includes/dataitems/SMW_DI_WikiPage.php
M includes/datavalues/SMW_DV_WikiPage.php
A includes/specials/SpecialConcepts.php
M languages/SMW_Aliases.php
M languages/SMW_Messages.php
M tests/phpunit/SemanticMediaWikiTestCase.php
A tests/phpunit/SpecialPageTestCase.php
A tests/phpunit/includes/specials/SpecialConceptsTest.php
M tests/phpunit/includes/specials/SpecialsTest.php
11 files changed, 417 insertions(+), 13 deletions(-)

Approvals:
  Mwjames: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/SemanticMediaWiki.hooks.php b/SemanticMediaWiki.hooks.php
index fb3633c..94d18a2 100644
--- a/SemanticMediaWiki.hooks.php
+++ b/SemanticMediaWiki.hooks.php
@@ -465,7 +465,7 @@
                        $extraStats[wfMessage( 'smw-statistics-property-type' 
)->text()] = $wgLang->formatNum( $semanticStatistics['DECLPROPS'] );
                        $extraStats[wfMessage( 'smw-statistics-subobject-count' 
)->text()]  = $wgLang->formatNum( $semanticStatistics['SUBOBJECTS'] );
                        $extraStats[wfMessage( 'smw-statistics-query-inline' 
)->text()]  = $wgLang->formatNum( $semanticStatistics['QUERY'] );
-                       $extraStats[wfMessage( 'smw-statistics-concept-count' 
)->text()]  = $wgLang->formatNum( $semanticStatistics['CONCEPTS'] );
+                       $extraStats[wfMessage( 
'smw-statistics-concept-count-legacy' )->text()]  = $wgLang->formatNum( 
$semanticStatistics['CONCEPTS'] );
                } else {
                        $extraStats['smw-statistics'] = array();
                        
$extraStats['smw-statistics']['smw-statistics-property-instance'] = 
$semanticStatistics['PROPUSES'];
diff --git a/includes/Setup.php b/includes/Setup.php
index 240fe47..6e113ea 100644
--- a/includes/Setup.php
+++ b/includes/Setup.php
@@ -206,6 +206,7 @@
        $wgAutoloadClasses['SMWStringLengthException']  = $diDir . 
'SMW_DI_String.php';
        $wgAutoloadClasses['SMWDIUri']                  = $diDir . 
'SMW_DI_URI.php';
        $wgAutoloadClasses['SMWDIWikiPage']             = $diDir . 
'SMW_DI_WikiPage.php';
+       $wgAutoloadClasses['SMW\DIWikiPage']            = $diDir . 
'SMW_DI_WikiPage.php'; // 1.9
        $wgAutoloadClasses['SMWDITime']                 = $diDir . 
'SMW_DI_Time.php';
        $wgAutoloadClasses['SMWDIError']                = $diDir . 
'SMW_DI_Error.php';
        $wgAutoloadClasses['SMWDIGeoCoord']             = $diDir . 
'SMW_DI_GeoCoord.php';
@@ -223,6 +224,7 @@
        $wgAutoloadClasses['SMWErrorValue']             = $dvDir . 
'SMW_DV_Error.php';
        $wgAutoloadClasses['SMWStringValue']            = $dvDir . 
'SMW_DV_String.php';
        $wgAutoloadClasses['SMWWikiPageValue']          = $dvDir . 
'SMW_DV_WikiPage.php';
+       $wgAutoloadClasses['SMW\WikiPageValue']         = $dvDir . 
'SMW_DV_WikiPage.php'; // 1.9
        $wgAutoloadClasses['SMWPropertyValue']          = $dvDir . 
'SMW_DV_Property.php';
        $wgAutoloadClasses['SMWURIValue']               = $dvDir . 
'SMW_DV_URI.php';
        $wgAutoloadClasses['SMWTypesValue']             = $dvDir . 
'SMW_DV_Types.php';
@@ -339,6 +341,7 @@
        // Special pages and closely related helper classes
        $specDir = $smwgIP . 'includes/specials/';
        $wgAutoloadClasses['SMW\SpecialSemanticStatistics'] = $specDir . 
'SpecialSemanticStatistics.php';
+       $wgAutoloadClasses['SMW\SpecialConcepts']           = $specDir . 
'SpecialConcepts.php';
 
        $wgAutoloadClasses['SMWAskPage']                    = $specDir . 
'SMW_SpecialAsk.php';
        $wgAutoloadClasses['SMWQueryUIHelper']              = $specDir . 
'SMW_QueryUIHelper.php';
@@ -365,6 +368,7 @@
        $wgAutoloadClasses['SMW\Test\ParserTestCase']             = $testsDir . 
'ParserTestCase.php';
        $wgAutoloadClasses['SMW\Test\ApiTestCase']                = $testsDir . 
'ApiTestCase.php';
        $wgAutoloadClasses['SMW\Test\MockSuperUser']              = $testsDir . 
'MockSuperUser.php';
+       $wgAutoloadClasses['SMW\Test\SpecialPageTestCase']        = $testsDir . 
'SpecialPageTestCase.php';
 
        // Jobs
        $wgJobClasses['SMWUpdateJob']       = 'SMWUpdateJob';
@@ -420,6 +424,10 @@
                        'page' => 'SMW\SpecialSemanticStatistics',
                        'group' => 'wiki'
                ),
+               'Concepts' => array(
+                       'page' => 'SMW\SpecialConcepts',
+                       'group' => 'pages'
+               ),
                'ExportRDF' => array(
                        'page' => 'SMWSpecialOWLExport',
                        'group' => 'smw_group'
diff --git a/includes/dataitems/SMW_DI_WikiPage.php 
b/includes/dataitems/SMW_DI_WikiPage.php
index 0ce4216..cb78bf9 100644
--- a/includes/dataitems/SMW_DI_WikiPage.php
+++ b/includes/dataitems/SMW_DI_WikiPage.php
@@ -163,3 +163,10 @@
                return $di->getSerialization() === $this->getSerialization();
        }
 }
+
+/**
+ * SMW\DIWikiPage
+ *
+ * @since 1.9
+ */
+class_alias( 'SMWDIWikiPage', 'SMW\DIWikiPage' );
diff --git a/includes/datavalues/SMW_DV_WikiPage.php 
b/includes/datavalues/SMW_DV_WikiPage.php
index f0e4a3b..bd74bf3 100644
--- a/includes/datavalues/SMW_DV_WikiPage.php
+++ b/includes/datavalues/SMW_DV_WikiPage.php
@@ -283,7 +283,7 @@
                        return $linker->makeMediaLinkObj( $this->getTitle(),
                                htmlspecialchars( $this->getLongCaptionText() ) 
);
                } else { // all others use default linking, no embedding of 
images here
-                       return $linker->makeLinkObj( $this->getTitle(),
+                       return $linker->link( $this->getTitle(),
                                htmlspecialchars( $this->getLongCaptionText() ) 
);
                }
        }
@@ -524,3 +524,9 @@
 
 }
 
+/**
+ * SMW\WikiPageValue
+ *
+ * @since 1.9
+ */
+class_alias( 'SMWWikiPageValue', 'SMW\WikiPageValue' );
diff --git a/includes/specials/SpecialConcepts.php 
b/includes/specials/SpecialConcepts.php
new file mode 100644
index 0000000..c0b81df
--- /dev/null
+++ b/includes/specials/SpecialConcepts.php
@@ -0,0 +1,133 @@
+<?php
+
+namespace SMW;
+
+use SMWThingDescription;
+use SMWSomeProperty;
+use SMWDIProperty;
+use SMWPageLister;
+
+use SpecialPage;
+use Html;
+
+/**
+ * Special page that lists available concepts
+ *
+ * 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 1.9
+ *
+ * @file
+ *
+ * @license GNU GPL v2+
+ * @author mwjames
+ */
+
+/**
+ * Special page that lists available concepts
+ *
+ * @ingroup SpecialPage
+ */
+class SpecialConcepts extends SpecialPage {
+
+       /**
+        * @see SpecialPage::__construct
+        */
+       public function __construct() {
+               parent::__construct( 'Concepts' );
+       }
+
+       /**
+        * Returns concept pages
+        *
+        * @since 1.9
+        *
+        * @param integer $limit
+        * @param integer $from
+        * @param integer $until
+        *
+        * @return DIWikiPage[]
+        */
+       public function getResults( $limit, $from, $until ) {
+               $description = new SMWSomeProperty( new SMWDIProperty( '_CONC' 
), new SMWThingDescription() );
+               $query = SMWPageLister::getQuery( $description, $limit, $from, 
$until );
+               return StoreFactory::getStore()->getQueryResult( $query 
)->getResults();
+       }
+
+       /**
+        * Returns html
+        *
+        * @since 1.9
+        *
+        * @param DIWikiPage[] $diWikiPages
+        * @param integer $limit
+        * @param integer $from
+        * @param integer $until
+        *
+        * @return string
+        */
+       public function getHtml( $diWikiPages, $limit, $from, $until ) {
+               $resultNumber = min( $limit, count( $diWikiPages ) );
+               $pageLister   = new SMWPageLister( $diWikiPages, null, $limit, 
$from, $until );
+               $key = $resultNumber == 0 ? 'smw-sp-concept-empty' : 
'smw-sp-concept-count';
+
+               return Html::rawElement(
+                       'span',
+                       array( 'class' => 'smw-sp-concept-docu' ),
+                       $this->msg( 'smw-sp-concept-docu' )->parse()
+                       ) .
+                       Html::rawElement(
+                               'div',
+                               array( 'id' => 'mw-pages'),
+                               Html::element(
+                                       'h2',
+                                       array(),
+                                       $this->msg( 'smw-sp-concept-header' 
)->text()
+                               ) .
+                               Html::element(
+                                       'span',
+                                       array( 'class' => $key ),
+                                       $this->msg( $key, $resultNumber 
)->parse()
+                               ) .     ' ' .
+                               $pageLister->getNavigationLinks( 
$this->getTitle() ) .
+                               $pageLister->formatList()
+                       );
+       }
+
+       /**
+        * Executes and outputs results for available concepts
+        *
+        * @since 1.9
+        *
+        * @param array $param
+        */
+       public function execute( $param ) {
+               wfProfileIn( __METHOD__ );
+
+               $this->getOutput()->setPageTitle( $this->msg( 'concepts' 
)->text() );
+
+               $from  = $this->getRequest()->getVal( 'from' , '' );
+               $until = $this->getRequest()->getVal( 'until', '' );
+               $limit = $this->getRequest()->getVal( 'limit', 50 );
+
+               $diWikiPages = $this->getResults( $limit, $from, $until );
+               $diWikiPages = $until !== '' ? array_reverse( $diWikiPages ) : 
$diWikiPages;
+
+               $this->getOutput()->addHTML( $this->getHtml( $diWikiPages, 
$limit, $from , $until ) );
+
+               wfProfileOut( __METHOD__ );
+       }
+}
diff --git a/languages/SMW_Aliases.php b/languages/SMW_Aliases.php
index 9941acb..bca190e 100644
--- a/languages/SMW_Aliases.php
+++ b/languages/SMW_Aliases.php
@@ -16,6 +16,7 @@
        'ExportRDF' => array( 'ExportRDF' ),
        'PageProperty' => array( 'PageProperty' ),
        'Properties' => array( 'Properties' ),
+       'Concepts' => array( 'Concepts' ),
        'SMWAdmin' => array( 'SMWAdmin' ),
        'SearchByProperty' => array( 'SearchByProperty' ),
        'SemanticStatistics' => array( 'SemanticStatistics' ),
diff --git a/languages/SMW_Messages.php b/languages/SMW_Messages.php
index 097c5c8..5c27188 100644
--- a/languages/SMW_Messages.php
+++ b/languages/SMW_Messages.php
@@ -188,6 +188,13 @@
        'smw_propertyhardlyused' => 'This property is hardly used within the 
wiki!',
        'smw-property-name-invalid' => 'Property $1 can not be used (invalid 
property name).',
 
+       // Messages for Concepts Special
+       'concepts'              => 'Concepts',
+       'smw-sp-concept-docu'   => 'A 
[https://www.semantic-mediawiki.org/wiki/Help:Concepts concept] can be viewed 
as "dynamic category", i.e. as a collection of pages that are not created 
manually, but that are computed by Semantic MediaWiki from a description of a 
given query.',
+       'smw-sp-concept-header' => 'List of concepts',
+       'smw-sp-concept-count'  => 'The following {{PLURAL:$1|concept|$1 
concepts}} {{PLURAL:$1|is|are}} being listed.',
+       'smw-sp-concept-empty'  => 'No concept was found.',
+
        // Messages for Unused Properties Special
        'unusedproperties' => 'Unused properties',
        'smw_unusedproperties_docu' => 'The following properties exist although 
no other page makes use of them.',
@@ -221,7 +228,8 @@
        'smw-statistics-property-type'  => '{{PLURAL:$1|Property|Properties}} 
(assigned to a datatype)',
        'smw-statistics-query-inline'   => '{{PLURAL:$1|Query|Queries}}',
        'smw-statistics-query-size'     => 'Query size',
-       'smw-statistics-concept-count'  => '{{PLURAL:$1|Concept|Concepts}}',
+       'smw-statistics-concept-count-legacy'  => 
'{{PLURAL:$1|Concept|Concepts}}',
+       'smw-statistics-concept-count'  => 
'[[Special:Concepts|{{PLURAL:$1|Concept|Concepts}}]]',
        'smw-statistics-subobject-count'  => 
'{{PLURAL:$1|Subobject|Subobjects}}',
        'smw-statistics-datatype-count' => 
'[[Special:Types|{{PLURAL:$1|Datatype|Datatypes}}]]',
 
@@ -418,7 +426,7 @@
        // User preference
        'prefs-smw' => 'Semantic MediaWiki',
        'prefs-ask-options' => 'Semantic search options',
-       'smw-prefs-intro-text' => 'Options below are provided by 
[http://semantic-mediawiki.org/ Semantic MediaWiki] (or related extensions) to 
enable individual customization on selected functions. For more information, 
please have a look at this 
[http://semantic-mediawiki.org/wiki/Help:User_preferences help section].',
+       'smw-prefs-intro-text' => 'Options below are provided by 
[https://semantic-mediawiki.org/ Semantic MediaWiki] (or related extensions) to 
enable individual customization on selected functions. For more information, 
please have a look at this 
[http://semantic-mediawiki.org/wiki/Help:User_preferences help section].',
        'smw-prefs-ask-options-tooltip-display' => 'Display parameter text as 
an info tooltip',
        'smw-prefs-ask-options-collapsed-default' => 'Enable option box to be 
collapsed by default',
 
@@ -709,6 +717,7 @@
        'smw-statistics-property-type' => 'Is a label that is displayed on the 
[[Special:Statistics|Statistics]] page',
        'smw-statistics-query-inline' => 'Is a label that is displayed on the 
[[Special:Statistics|Statistics]] page',
        'smw-statistics-query-size' => 'Is a label that is displayed on the 
[[Special:Statistics|Statistics]] page',
+       'smw-statistics-concept-count-legacy' => 'Is a label that is displayed 
on the [[Special:Statistics|Statistics]] page.',
        'smw-statistics-concept-count' => 'Is a label that is displayed on the 
[[Special:Statistics|Statistics]] page.
 {{Identical|Concept}}',
        'smw-statistics-subobject-count' => 'Is a label that is displayed on 
the [[Special:Statistics|Statistics]] page',
@@ -998,6 +1007,11 @@
 * $1 - Name of the invoked predefined property',
        'smw-pa-property-predefined_ask'   => 'Describes a predefined 
property.',
        'smw-pa-property-predefined_asksi' => 'Describes a predefined 
property.',
+       'concepts'              => '{{doc-special|Concepts}}',
+       'smw-sp-concept-docu'   => 'This is an introductory message at the top 
of [[Special:Concepts]].',
+       'smw-sp-concept-header' => 'This is a header used on 
[[Special:Concepts]].',
+       'smw-sp-concept-count'  => 'This is used on [[Special:Concepts]] and to 
display available concepts',
+       'smw-sp-concept-empty'  => 'This is used on [[Special:Concepts]] and to 
display that no concepts are available.',
 );
 
 /** Afrikaans (Afrikaans)
diff --git a/tests/phpunit/SemanticMediaWikiTestCase.php 
b/tests/phpunit/SemanticMediaWikiTestCase.php
index c4be5e5..be1c2ae 100644
--- a/tests/phpunit/SemanticMediaWikiTestCase.php
+++ b/tests/phpunit/SemanticMediaWikiTestCase.php
@@ -3,12 +3,12 @@
 namespace SMW\Test;
 
 use SMW\DataValueFactory;
+use SMW\DIWikiPage;
 use SMW\Settings;
 
 use Title;
 use Language;
 
-use SMWDIWikiPage;
 use SMWSemanticData;
 use SMWDataItem;
 
@@ -95,16 +95,16 @@
        }
 
        /**
-        * Helper method that returns a randomized SMWDIWikiPage object
+        * Helper method that returns a randomized DIWikiPage object
         *
         * @since 1.9
         *
         * @param $namespace
         *
-        * @return SMWDIWikiPage
+        * @return DIWikiPage
         */
        protected function getSubject( $namespace = NS_MAIN ) {
-               return SMWDIWikiPage::newFromTitle( $this->getTitle( $namespace 
) );
+               return DIWikiPage::newFromTitle( $this->getTitle( $namespace ) 
);
        }
 
        /**
diff --git a/tests/phpunit/SpecialPageTestCase.php 
b/tests/phpunit/SpecialPageTestCase.php
new file mode 100644
index 0000000..b4cf1ef
--- /dev/null
+++ b/tests/phpunit/SpecialPageTestCase.php
@@ -0,0 +1,117 @@
+<?php
+
+namespace SMW\Test;
+
+use DerivativeContext;
+use RequestContext;
+use FauxRequest;
+use WebRequest;
+use OutputPage;
+
+/**
+ * Class contains methods to access SpecialPages
+ *
+ * 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 1.9
+ *
+ * @file
+ *
+ * @license GNU GPL v2+
+ * @author mwjames
+ */
+
+/**
+ * Class contains methods to access SpecialPages
+ *
+ * @ingroup Test
+ *
+ * @group SMW
+ * @group SMWExtension
+ */
+abstract class SpecialPageTestCase extends SemanticMediaWikiTestCase {
+
+       /**
+        * Returns a new instance of the special page under test.
+        *
+        * @return \SpecialPage
+        */
+       protected abstract function getInstance();
+
+       /**
+        * This is borrowed from \Wikibase\Test\SpecialPageTestBase
+        *
+        * @param string      $sub The subpage parameter to call the page with
+        * @param \WebRequest $request Web request that may contain URL 
parameters, etc
+        */
+       protected function execute( $sub = '', WebRequest $request = null ) {
+
+               $request = $request === null ? new FauxRequest() : $request;
+               $response = $request->response();
+
+               $context = new DerivativeContext( RequestContext::getMain() );
+               $context->setRequest( $request );
+
+               $out = new OutputPage( $context );
+               $context->setOutput( $out );
+
+               $page = $this->getInstance();
+               $page->setContext( $context );
+
+               $out->setTitle( $page->getTitle() );
+
+               ob_start();
+               $page->execute( $sub );
+
+               if ( $out->getRedirect() !== '' ) {
+                       $out->output();
+                       $text = ob_get_contents();
+               } elseif ( $out->isDisabled() ) {
+                       $text = ob_get_contents();
+               } else {
+                       $text = $out->getHTML();
+               }
+
+               ob_end_clean();
+
+               $code = $response->getStatusCode();
+
+               if ( $code > 0 ) {
+                       $response->header( "Status: " . $code . ' ' . 
\HttpStatus::getMessage( $code ) );
+               }
+
+               $this->text = $text;
+               $this->response = $response;
+       }
+
+       /**
+        * Returns output text
+        *
+        * @return string
+        */
+       protected function getOutput() {
+               return $this->text;
+       }
+
+       /**
+        * Returns response object
+        *
+        * @return FauxResponse
+        */
+       protected function getResponse() {
+               return $this->response;
+       }
+}
diff --git a/tests/phpunit/includes/specials/SpecialConceptsTest.php 
b/tests/phpunit/includes/specials/SpecialConceptsTest.php
new file mode 100644
index 0000000..7d6a75c
--- /dev/null
+++ b/tests/phpunit/includes/specials/SpecialConceptsTest.php
@@ -0,0 +1,117 @@
+<?php
+
+namespace SMW\Test;
+
+use SMW\SpecialConcepts;
+use SMW\DIWikiPage;
+use SMWDataItem;
+
+/**
+ * Tests for the SpecialConcepts 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
+ *
+ * @since 1.9
+ *
+ * @file
+ *
+ * @license GNU GPL v2+
+ * @author mwjames
+ */
+
+/**
+ * @covers SMW\SpecialConcepts
+ *
+ * @ingroup Test
+ *
+ * @group SMW
+ * @group SMWExtension
+ */
+class SpecialConceptsTest extends SpecialPageTestCase {
+
+       /**
+        * Returns the name of the class to be tested
+        *
+        * @return string|false
+        */
+       public function getClass() {
+               return '\SMW\SpecialConcepts';
+       }
+
+       /**
+        * Helper method that returns a SpecialConcepts object
+        *
+        * @since 1.9
+        *
+        * @param $result
+        *
+        * @return SpecialConcepts
+        */
+       protected function getInstance() {
+               return new SpecialConcepts();
+       }
+
+       /**
+        * @test SpecialConcepts::__construct
+        *
+        * @since 1.9
+        */
+       public function testConstructor() {
+               $instance = $this->getInstance();
+               $this->assertInstanceOf( $this->getClass(), $instance );
+       }
+
+       /**
+        * @test SpecialConcepts::execute
+        *
+        * @since 1.9
+        */
+       public function testExecute() {
+
+               $this->getInstance();
+               $this->execute();
+
+               $matches = array(
+                       'tag' => 'span',
+                       'attributes' => array( 'class' => 'smw-sp-concept-docu' 
)
+               );
+
+               $this->assertTag( $matches, $this->getOutput() );
+       }
+
+       /**
+        * @test SpecialConcepts::getHtml
+        *
+        * @since 1.9
+        */
+       public function testGetHtml() {
+
+               $instance = $this->getInstance();
+
+               $matches = array(
+                       'tag' => 'span',
+                       'attributes' => array( 'class' => 
'smw-sp-concept-empty' )
+               );
+               $this->assertTag( $matches, $instance->getHtml( array(), 0, 0, 
0 ) );
+
+               $matches = array(
+                       'tag' => 'span',
+                       'attributes' => array( 'class' => 
'smw-sp-concept-count' )
+               );
+               $this->assertTag( $matches, $instance->getHtml( array( 
$this->getSubject() ), 1, 1, 1 ) );
+
+       }
+}
diff --git a/tests/phpunit/includes/specials/SpecialsTest.php 
b/tests/phpunit/includes/specials/SpecialsTest.php
index dc021c5..0d7bd7e 100644
--- a/tests/phpunit/includes/specials/SpecialsTest.php
+++ b/tests/phpunit/includes/specials/SpecialsTest.php
@@ -29,7 +29,6 @@
  * @since 1.9
  *
  * @file
- * @ingroup Test
  *
  * @licence GNU GPL v2+
  * @author Jeroen De Dauw < [email protected] >
@@ -37,14 +36,15 @@
  */
 
 /**
- * Tests for registered special pages (Test base was borrowed from the
- * EducationProgram extension)
+ * @covers SMWSpecialWantedProperties
+ * @covers SMW\SpecialConcepts
+ *
+ * @note Test base was borrowed from the EducationProgram extension
  *
  * @ingroup Test
  *
  * @group SMW
  * @group SMWExtension
- * @covers SMWSpecialWantedProperties
  */
 class SpecialsTest extends SemanticMediaWikiTestCase {
 
@@ -130,7 +130,8 @@
                        'Types',
                        'Properties',
                        'UnusedProperties',
-                       'WantedProperties'
+                       'WantedProperties',
+                       'Concepts'
 
                        // Can't be tested because of
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I4901a2814e9e9c514dbd2b5abf4be74002319f6e
Gerrit-PatchSet: 5
Gerrit-Project: mediawiki/extensions/SemanticMediaWiki
Gerrit-Branch: master
Gerrit-Owner: Mwjames <[email protected]>
Gerrit-Reviewer: Jeroen De Dauw <[email protected]>
Gerrit-Reviewer: Kghbln <[email protected]>
Gerrit-Reviewer: Mwjames <[email protected]>
Gerrit-Reviewer: jenkins-bot

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

Reply via email to