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

Change subject: Make tests for expected URLs more robust
......................................................................


Make tests for expected URLs more robust

By actually using the expected form for the assertions and
not just one that happens to match depending on configuration.

Change-Id: Ie7937cb88339b8c3f988c87f118479b7bd7ba2db
---
M repo/tests/phpunit/includes/LinkedData/EntityDataUriManagerTest.php
M repo/tests/phpunit/includes/specials/SpecialItemByTitleTest.php
2 files changed, 4 insertions(+), 3 deletions(-)

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



diff --git 
a/repo/tests/phpunit/includes/LinkedData/EntityDataUriManagerTest.php 
b/repo/tests/phpunit/includes/LinkedData/EntityDataUriManagerTest.php
index 9725cd0..ab20489 100644
--- a/repo/tests/phpunit/includes/LinkedData/EntityDataUriManagerTest.php
+++ b/repo/tests/phpunit/includes/LinkedData/EntityDataUriManagerTest.php
@@ -182,7 +182,7 @@
 
        public static function provideGetCacheableUrls() {
                $title = Title::newFromText( "Special:EntityDataUriManagerTest" 
);
-               $base = $title->getFullURL();
+               $base = $title->getInternalURL();
 
                return array(
                        array( 'Q12', array(
diff --git a/repo/tests/phpunit/includes/specials/SpecialItemByTitleTest.php 
b/repo/tests/phpunit/includes/specials/SpecialItemByTitleTest.php
index 5ef25d0..ac176ed 100644
--- a/repo/tests/phpunit/includes/specials/SpecialItemByTitleTest.php
+++ b/repo/tests/phpunit/includes/specials/SpecialItemByTitleTest.php
@@ -165,8 +165,9 @@
                list( $output, $response ) = $this->executeSpecialPage( $sub );
 
                if ( $target !== null ) {
-                       $target = Title::newFromText( $target );
-                       $this->assertEquals( $target->getFullURL(), 
$response->getheader( 'Location' ), 'Redirect' );
+                       $target = Title::newFromText( $target )->getFullURL();
+                       $expected = wfExpandUrl( $target, PROTO_CURRENT );
+                       $this->assertEquals( $expected, $response->getheader( 
'Location' ), 'Redirect' );
                }
 
                foreach( $matchers as $key => $matcher ) {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie7937cb88339b8c3f988c87f118479b7bd7ba2db
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Hoo man <[email protected]>
Gerrit-Reviewer: Addshore <[email protected]>
Gerrit-Reviewer: Aude <[email protected]>
Gerrit-Reviewer: JanZerebecki <[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

Reply via email to