* upgrade patches for oracle 1.17->1.19
[mediawiki.git] / tests / phpunit / includes / TitleTest.php
blobc128fdd8cc6fcd99ec5b4abf90247e0fd28afa54
1 <?php
3 class TitleTest extends MediaWikiTestCase {
5 function testLegalChars() {
6 $titlechars = Title::legalChars();
8 foreach ( range( 1, 255 ) as $num ) {
9 $chr = chr( $num );
10 if ( strpos( "#[]{}<>|", $chr ) !== false || preg_match( "/[\\x00-\\x1f\\x7f]/", $chr ) ) {
11 $this->assertFalse( (bool)preg_match( "/[$titlechars]/", $chr ), "chr($num) = $chr is not a valid titlechar" );
12 } else {
13 $this->assertTrue( (bool)preg_match( "/[$titlechars]/", $chr ), "chr($num) = $chr is a valid titlechar" );