From: Tim Starling Date: Tue, 31 May 2011 02:09:22 +0000 (+0000) Subject: Tests for r88883, including two failing tests. X-Git-Tag: 1.31.0-rc.0~29833 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/?a=commitdiff_plain;h=3f8de2d17517d63a61726039a8b1d61b627ca625;p=lhc%2Fweb%2Fwiklou.git Tests for r88883, including two failing tests. --- diff --git a/tests/phpunit/includes/FindIE6ExtensionTest.php b/tests/phpunit/includes/FindIE6ExtensionTest.php new file mode 100644 index 0000000000..d1d534144a --- /dev/null +++ b/tests/phpunit/includes/FindIE6ExtensionTest.php @@ -0,0 +1,102 @@ +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' + ); + } +}