3 class IEUrlExtensionTest
extends PHPUnit\Framework\TestCase
{
5 use MediaWikiCoversValidator
;
7 public function provideFindIE6Extension() {
9 // url, expected, message
10 [ 'x.y', 'y', 'Simple extension' ],
11 [ 'x', '', 'No extension' ],
12 [ '', '', 'Empty string' ],
13 [ '?', '', 'Question mark only' ],
14 [ '.x?', 'x', 'Extension then question mark' ],
15 [ '?.x', 'x', 'Question mark then extension' ],
16 [ '.x*', '', 'Extension with invalid character' ],
17 [ '*.x', 'x', 'Invalid character followed by an extension' ],
18 [ 'a?b?.c?.d?e?f', 'c', 'Multiple question marks' ],
19 [ 'a?b?.exe?.d?.e', 'd', '.exe exception' ],
20 [ 'a?b?.exe', 'exe', '.exe exception 2' ],
21 [ 'a#b.c', '', 'Hash character preceding extension' ],
22 [ 'a?#b.c', '', 'Hash character preceding extension 2' ],
23 [ '.', '', 'Dot at end of string' ],
24 [ 'x.y.z', 'z', 'Two dots' ],
25 [ 'example.php?foo=a&bar=b', 'php', 'Script with query' ],
26 [ 'example%2Ephp?foo=a&bar=b', '', 'Script with urlencoded dot and query' ],
27 [ 'example%2Ephp?foo=a.x&bar=b.y', 'y', 'Script with urlencoded dot and query with dot' ],
32 * @covers IEUrlExtension::findIE6Extension
33 * @dataProvider provideFindIE6Extension
35 public function testFindIE6Extension( $url, $expected, $message ) {
38 IEUrlExtension
::findIE6Extension( $url ),