Adrian Lang has uploaded a new change for review.

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

Change subject: Isolate SectionEditLinkGeneratorTest from WikibaseRepo
......................................................................

Isolate SectionEditLinkGeneratorTest from WikibaseRepo

Change-Id: I4c64e2f64e9de19a960d697cc3d38dcd0a8d59e2
---
M repo/tests/phpunit/includes/View/SectionEditLinkGeneratorTest.php
1 file changed, 40 insertions(+), 2 deletions(-)


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

diff --git a/repo/tests/phpunit/includes/View/SectionEditLinkGeneratorTest.php 
b/repo/tests/phpunit/includes/View/SectionEditLinkGeneratorTest.php
index 604e3d7..6d6b5bc 100644
--- a/repo/tests/phpunit/includes/View/SectionEditLinkGeneratorTest.php
+++ b/repo/tests/phpunit/includes/View/SectionEditLinkGeneratorTest.php
@@ -2,7 +2,8 @@
 
 namespace Wikibase\Test;
 
-use MediaWikiLangTestCase;
+use MediaWikiTestCase;
+use SpecialPage;
 use Wikibase\Repo\View\SectionEditLinkGenerator;
 use Wikibase\Template\TemplateFactory;
 use Wikibase\Template\TemplateRegistry;
@@ -19,8 +20,37 @@
  * @author Daniel Kinzler
  * @author Adrian Lang
  */
-class SectionEditLinkGeneratorTest extends MediaWikiLangTestCase {
+class SectionEditLinkGeneratorTest extends MediaWikiTestCase {
 
+       protected function setUp() {
+               // Make sure wgSpecialPages has the special pages this tests use
+               $this->setMwGlobals(
+                       'wgSpecialPages',
+                       array(
+                               'Version' => new SpecialPage( 'Version' ),
+                               'SetLabel' => new SpecialPage( 'SetLabel'),
+                               'FooBar' => new SpecialPage( 'FooBar' )
+                       )
+               );
+
+               $doubleLanguage = $this->getMock( 'Language', array( 
'getSpecialPageAliases' ) );
+               $doubleLanguage->mCode = 'en';
+               $doubleLanguage->expects( $this->any() )
+                       ->method( 'getSpecialPageAliases' )
+                       ->will( $this->returnValue(
+                               array(
+                                       'Version' => array( 'Version' ),
+                                       'SetLabel' => array( 'SetLabel' ),
+                                       'FooBar' => array( 'FooBar' ),
+                               )
+                       ) );
+
+               $this->setMwGlobals(
+                       'wgContLang',
+                       $doubleLanguage
+               );
+               parent::setUp();
+       }
        /**
         * @dataProvider getHtmlForEditSectionProvider
         */
@@ -92,6 +122,14 @@
                                ),
                                'SetLabel',
                                array( 'Q1', 'de' ),
+                       ),
+                       array(
+                               array(
+                                       'tag' => 'a',
+                                       'attributes' => array( 'href' => 
'regexp:+\bSpecial:FooBar/Q1/de$+' )
+                               ),
+                               'FooBar',
+                               array( 'Q1', 'de' ),
                        )
                );
        }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4c64e2f64e9de19a960d697cc3d38dcd0a8d59e2
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Adrian Lang <[email protected]>

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

Reply via email to