summaryrefslogtreecommitdiff
path: root/maintenance/tests/TitleTest.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2010-07-28 11:52:48 +0200
committerPierre Schmitz <pierre@archlinux.de>2010-07-28 11:52:48 +0200
commit222b01f5169f1c7e69762e0e8904c24f78f71882 (patch)
tree8e932e12546bb991357ec48eb1638d1770be7a35 /maintenance/tests/TitleTest.php
parent00ab76a6b686e98a914afc1975812d2b1aaa7016 (diff)
update to MediaWiki 1.16.0
Diffstat (limited to 'maintenance/tests/TitleTest.php')
-rw-r--r--maintenance/tests/TitleTest.php17
1 files changed, 17 insertions, 0 deletions
diff --git a/maintenance/tests/TitleTest.php b/maintenance/tests/TitleTest.php
new file mode 100644
index 00000000..5b42c1c5
--- /dev/null
+++ b/maintenance/tests/TitleTest.php
@@ -0,0 +1,17 @@
+<?php
+
+class TitleTest extends PHPUnit_Framework_TestCase {
+
+ function testLegalChars() {
+ $titlechars = Title::legalChars();
+
+ foreach ( range( 1, 255 ) as $num ) {
+ $chr = chr( $num );
+ if ( strpos( "#[]{}<>|", $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" );
+ }
+ }
+ }
+}