00001 <?php 00002 00003 class TitleTest extends PHPUnit_Framework_TestCase { 00004 00005 function testLegalChars() { 00006 $titlechars = Title::legalChars(); 00007 00008 foreach ( range( 1, 255 ) as $num ) { 00009 $chr = chr( $num ); 00010 if ( strpos( "#[]{}<>|", $chr ) !== false || preg_match( "/[\\x00-\\x1f\\x7f]/", $chr ) ) { 00011 $this->assertFalse( (bool)preg_match( "/[$titlechars]/", $chr ), "chr($num) = $chr is not a valid titlechar" ); 00012 } else { 00013 $this->assertTrue( (bool)preg_match( "/[$titlechars]/", $chr ), "chr($num) = $chr is a valid titlechar" ); 00014 } 00015 } 00016 } 00017 }