http://www.mediawiki.org/wiki/Special:Code/MediaWiki/89197
Revision: 89197
Author: tstarling
Date: 2011-05-31 02:09:22 +0000 (Tue, 31 May 2011)
Log Message:
-----------
Tests for r88883, including two failing tests.
Added Paths:
-----------
trunk/phase3/tests/phpunit/includes/FindIE6ExtensionTest.php
Added: trunk/phase3/tests/phpunit/includes/FindIE6ExtensionTest.php
===================================================================
--- trunk/phase3/tests/phpunit/includes/FindIE6ExtensionTest.php
(rev 0)
+++ trunk/phase3/tests/phpunit/includes/FindIE6ExtensionTest.php
2011-05-31 02:09:22 UTC (rev 89197)
@@ -0,0 +1,102 @@
+<?php
+
+/**
+ * Tests for WebRequest::findIE6Extension
+ */
+class FindIE6ExtensionTest extends MediaWikiTestCase {
+ function testSimple() {
+ $this->assertEquals(
+ WebRequest::findIE6Extension( 'x.y' ),
+ 'y',
+ 'Simple extension'
+ );
+ }
+
+ function testSimpleNoExt() {
+ $this->assertEquals(
+ WebRequest::findIE6Extension( 'x' ),
+ '',
+ 'No extension'
+ );
+ }
+
+ function testEmpty() {
+ $this->assertEquals(
+ WebRequest::findIE6Extension( '' ),
+ '',
+ 'Empty string'
+ );
+ }
+
+ function testQuestionMark() {
+ $this->assertEquals(
+ WebRequest::findIE6Extension( '?' ),
+ '',
+ 'Question mark only'
+ );
+ }
+
+ function testExtQuestionMark() {
+ $this->assertEquals(
+ WebRequest::findIE6Extension( '.x?' ),
+ 'x',
+ 'Extension then question mark'
+ );
+ }
+
+ function testQuestionMarkExt() {
+ $this->assertEquals(
+ WebRequest::findIE6Extension( '?.x' ),
+ 'x',
+ 'Question mark then extension'
+ );
+ }
+
+ function testInvalidChar() {
+ $this->assertEquals(
+ WebRequest::findIE6Extension( '.x*' ),
+ '',
+ 'Extension with invalid character'
+ );
+ }
+
+ function testMultipleQuestionMarks() {
+ $this->assertEquals(
+ WebRequest::findIE6Extension( 'a?b?.c?.d?e?f' ),
+ 'c',
+ 'Multiple question marks'
+ );
+ }
+
+ function testExeException() {
+ $this->assertEquals(
+ WebRequest::findIE6Extension( 'a?b?.exe?.d?.e' ),
+ 'd',
+ '.exe exception'
+ );
+ }
+
+ function testExeException2() {
+ $this->assertEquals(
+ WebRequest::findIE6Extension( 'a?b?.exe' ),
+ 'exe',
+ '.exe exception 2'
+ );
+ }
+
+ function testHash() {
+ $this->assertEquals(
+ WebRequest::findIE6Extension( 'a#b.c' ),
+ '',
+ 'Hash character preceding extension'
+ );
+ }
+
+ function testHash2() {
+ $this->assertEquals(
+ WebRequest::findIE6Extension( 'a?#b.c' ),
+ '',
+ 'Hash character preceding extension 2'
+ );
+ }
+}
Property changes on:
trunk/phase3/tests/phpunit/includes/FindIE6ExtensionTest.php
___________________________________________________________________
Added: svn:eol-style
+ native
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs