Krinkle has uploaded a new change for review.

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

Change subject: IEUrlExtension: Add tests for the main use case the lib exists 
for
......................................................................

IEUrlExtension: Add tests for the main use case the lib exists for

There are plenty of tests for the basic behaviour of the extension
detector and how IE favours the extension from the first question mark
segment that has a dot in the next segment.

But it was missing a test for the main use case the library exists
for, which is extensions in query strings when there is a file name
with extension already (but the dot is urlencoded).

Change-Id: I0f2e1387ae42da68020f1d793bb9eb5a87a06f24
---
M tests/phpunit/includes/libs/IEUrlExtensionTest.php
1 file changed, 33 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/06/234506/1

diff --git a/tests/phpunit/includes/libs/IEUrlExtensionTest.php 
b/tests/phpunit/includes/libs/IEUrlExtensionTest.php
index e96953e..57668e5 100644
--- a/tests/phpunit/includes/libs/IEUrlExtensionTest.php
+++ b/tests/phpunit/includes/libs/IEUrlExtensionTest.php
@@ -170,4 +170,37 @@
                        'Two dots'
                );
        }
+
+       /**
+        * @covers IEUrlExtension::findIE6Extension
+        */
+       public function testScriptQuery() {
+               $this->assertEquals(
+                       'php',
+                       IEUrlExtension::findIE6Extension( 
'example.php?foo=a&bar=b' ),
+                       'Script with query'
+               );
+       }
+
+       /**
+        * @covers IEUrlExtension::findIE6Extension
+        */
+       public function testEscapedScriptQuery() {
+               $this->assertEquals(
+                       '',
+                       IEUrlExtension::findIE6Extension( 
'example%2Ephp?foo=a&bar=b' ),
+                       'Script with urlencoded dot and query'
+               );
+       }
+
+       /**
+        * @covers IEUrlExtension::findIE6Extension
+        */
+       public function testEscapedScriptQueryDot() {
+               $this->assertEquals(
+                       'y',
+                       IEUrlExtension::findIE6Extension( 
'example%2Ephp?foo=a.x&bar=b.y' ),
+                       'Script with urlencoded dot and query with dot'
+               );
+       }
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0f2e1387ae42da68020f1d793bb9eb5a87a06f24
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Krinkle <[email protected]>

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

Reply via email to