|", $chr ) !== false || preg_match( "/[\\x00-\\x1f\\x7f]/", $chr ) ) { $this->assertFalse( (bool)preg_match( "/[$titlechars]/", $chr ), "chr($num) = $chr is not a valid titlechar" ); } else { $this->assertTrue( (bool)preg_match( "/[$titlechars]/", $chr ), "chr($num) = $chr is a valid titlechar" ); } } } /** * @dataProvider dataBug31100 */ function testBug31100FixSpecialName( $text, $expectedParam ) { $title = Title::newFromText( $text ); $fixed = $title->fixSpecialName(); $stuff = explode( '/', $fixed->getDbKey(), 2 ); if ( count( $stuff ) == 2 ) { $par = $stuff[1]; } else { $par = null; } $this->assertEquals( $expectedParam, $par, "Bug 31100 regression check: Title->fixSpecialName() should preserve parameter" ); } function dataBug31100() { return array( array( 'Special:Version', null ), array( 'Special:Version/', '' ), array( 'Special:Version/param', 'param' ), ); } }