r89197 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r89196‎ | r89197 | r89198 >
Date:02:09, 31 May 2011
Author:tstarling
Status:resolved
Tags:
Comment:
Tests for r88883, including two failing tests.
Modified paths:
  • /trunk/phase3/tests/phpunit/includes/FindIE6ExtensionTest.php (added) (history)

Diff [purge]

Index: trunk/phase3/tests/phpunit/includes/FindIE6ExtensionTest.php
@@ -0,0 +1,102 @@
 2+<?php
 3+
 4+/**
 5+ * Tests for WebRequest::findIE6Extension
 6+ */
 7+class FindIE6ExtensionTest extends MediaWikiTestCase {
 8+ function testSimple() {
 9+ $this->assertEquals(
 10+ WebRequest::findIE6Extension( 'x.y' ),
 11+ 'y',
 12+ 'Simple extension'
 13+ );
 14+ }
 15+
 16+ function testSimpleNoExt() {
 17+ $this->assertEquals(
 18+ WebRequest::findIE6Extension( 'x' ),
 19+ '',
 20+ 'No extension'
 21+ );
 22+ }
 23+
 24+ function testEmpty() {
 25+ $this->assertEquals(
 26+ WebRequest::findIE6Extension( '' ),
 27+ '',
 28+ 'Empty string'
 29+ );
 30+ }
 31+
 32+ function testQuestionMark() {
 33+ $this->assertEquals(
 34+ WebRequest::findIE6Extension( '?' ),
 35+ '',
 36+ 'Question mark only'
 37+ );
 38+ }
 39+
 40+ function testExtQuestionMark() {
 41+ $this->assertEquals(
 42+ WebRequest::findIE6Extension( '.x?' ),
 43+ 'x',
 44+ 'Extension then question mark'
 45+ );
 46+ }
 47+
 48+ function testQuestionMarkExt() {
 49+ $this->assertEquals(
 50+ WebRequest::findIE6Extension( '?.x' ),
 51+ 'x',
 52+ 'Question mark then extension'
 53+ );
 54+ }
 55+
 56+ function testInvalidChar() {
 57+ $this->assertEquals(
 58+ WebRequest::findIE6Extension( '.x*' ),
 59+ '',
 60+ 'Extension with invalid character'
 61+ );
 62+ }
 63+
 64+ function testMultipleQuestionMarks() {
 65+ $this->assertEquals(
 66+ WebRequest::findIE6Extension( 'a?b?.c?.d?e?f' ),
 67+ 'c',
 68+ 'Multiple question marks'
 69+ );
 70+ }
 71+
 72+ function testExeException() {
 73+ $this->assertEquals(
 74+ WebRequest::findIE6Extension( 'a?b?.exe?.d?.e' ),
 75+ 'd',
 76+ '.exe exception'
 77+ );
 78+ }
 79+
 80+ function testExeException2() {
 81+ $this->assertEquals(
 82+ WebRequest::findIE6Extension( 'a?b?.exe' ),
 83+ 'exe',
 84+ '.exe exception 2'
 85+ );
 86+ }
 87+
 88+ function testHash() {
 89+ $this->assertEquals(
 90+ WebRequest::findIE6Extension( 'a#b.c' ),
 91+ '',
 92+ 'Hash character preceding extension'
 93+ );
 94+ }
 95+
 96+ function testHash2() {
 97+ $this->assertEquals(
 98+ WebRequest::findIE6Extension( 'a?#b.c' ),
 99+ '',
 100+ 'Hash character preceding extension 2'
 101+ );
 102+ }
 103+}
Property changes on: trunk/phase3/tests/phpunit/includes/FindIE6ExtensionTest.php
___________________________________________________________________
Added: svn:eol-style
1104 + native

Follow-up revisions

RevisionCommit summaryAuthorDate
r89245Fixes for r88883, r89197:...tstarling00:51, 1 June 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r88883(bug 28840) URLs with dots break because of IE6 security check...catrope09:49, 26 May 2011

Status & tagging log