1<?php 2 3class utf8_basename_test extends DokuWikiTest { 4 5 function test1(){ 6 $data = array( 7 array('/this/foo/bar.test.png', '', 'bar.test.png'), 8 array('\\this\\foo\\bar.test.png', '', 'bar.test.png'), 9 array('/this\\foo/bar.test.png', '', 'bar.test.png'), 10 array('/this/foo\\bar.test.png', '', 'bar.test.png'), 11 12 array('/this/ДокуВики/bar.test.png', '', 'bar.test.png'), 13 array('\\this\\ДокуВики\\bar.test.png', '', 'bar.test.png'), 14 array('/this\\ДокуВики/bar.test.png', '', 'bar.test.png'), 15 array('/this/ДокуВики\\bar.test.png', '', 'bar.test.png'), 16 17 array('/this/foo/ДокуВики.test.png', '', 'ДокуВики.test.png'), 18 array('\\this\\foo\\ДокуВики.test.png', '', 'ДокуВики.test.png'), 19 array('/this\\foo/ДокуВики.test.png', '', 'ДокуВики.test.png'), 20 array('/this/foo\\ДокуВики.test.png', '', 'ДокуВики.test.png'), 21 22 array('/this/foo/bar.test.png', '.png', 'bar.test'), 23 array('\\this\\foo\\bar.test.png', '.png', 'bar.test'), 24 array('/this\\foo/bar.test.png', '.png', 'bar.test'), 25 array('/this/foo\\bar.test.png', '.png', 'bar.test'), 26 27 array('/this/ДокуВики/bar.test.png', '.png', 'bar.test'), 28 array('\\this\\ДокуВики\\bar.test.png', '.png', 'bar.test'), 29 array('/this\\ДокуВики/bar.test.png', '.png', 'bar.test'), 30 array('/this/ДокуВики\\bar.test.png', '.png', 'bar.test'), 31 32 array('/this/foo/ДокуВики.test.png', '.png', 'ДокуВики.test'), 33 array('\\this\\foo\\ДокуВики.test.png', '.png', 'ДокуВики.test'), 34 array('/this\\foo/ДокуВики.test.png', '.png', 'ДокуВики.test'), 35 array('/this/foo\\ДокуВики.test.png', '.png', 'ДокуВики.test'), 36 37 array('/this/foo/bar.test.png', '.foo', 'bar.test.png'), 38 array('\\this\\foo\\bar.test.png', '.foo', 'bar.test.png'), 39 array('/this\\foo/bar.test.png', '.foo', 'bar.test.png'), 40 array('/this/foo\\bar.test.png', '.foo', 'bar.test.png'), 41 42 array('/this/ДокуВики/bar.test.png', '.foo', 'bar.test.png'), 43 array('\\this\\ДокуВики\\bar.test.png', '.foo', 'bar.test.png'), 44 array('/this\\ДокуВики/bar.test.png', '.foo', 'bar.test.png'), 45 array('/this/ДокуВики\\bar.test.png', '.foo', 'bar.test.png'), 46 47 array('/this/foo/ДокуВики.test.png', '.foo', 'ДокуВики.test.png'), 48 array('\\this\\foo\\ДокуВики.test.png', '.foo', 'ДокуВики.test.png'), 49 array('/this\\foo/ДокуВики.test.png', '.foo', 'ДокуВики.test.png'), 50 array('/this/foo\\ДокуВики.test.png', '.foo', 'ДокуВики.test.png'), 51 52 53 array('/this/foo/ДокуВики.test.Вик', '.foo', 'ДокуВики.test.Вик'), 54 array('\\this\\foo\\ДокуВики.test.Вик', '.foo', 'ДокуВики.test.Вик'), 55 array('/this\\foo/ДокуВики.test.Вик', '.foo', 'ДокуВики.test.Вик'), 56 array('/this/foo\\ДокуВики.test.Вик', '.foo', 'ДокуВики.test.Вик'), 57 58 array('/this/foo/ДокуВики.test.Вик', '.Вик', 'ДокуВики.test'), 59 array('\\this\\foo\\ДокуВики.test.Вик', '.Вик', 'ДокуВики.test'), 60 array('/this\\foo/ДокуВики.test.Вик', '.Вик', 'ДокуВики.test'), 61 array('/this/foo\\ДокуВики.test.Вик', '.Вик', 'ДокуВики.test'), 62 ); 63 64 foreach($data as $test){ 65 $this->assertEquals($test[2], utf8_basename($test[0], $test[1]), "input: ('".$test[0]."', '".$test[1]."')"); 66 } 67 } 68 69}