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" );
+ $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" );
+ $this->assertTrue(
+ (bool)preg_match( "/[$titlechars]/", $chr ),
+ "chr($num) = $chr is a valid titlechar"
+ );
}
}
}
'Foo/.../Sandbox',
'Sandbox/...',
'A~~',
+ ':A',
// Length is 256 total, but only title part matters
'Category:' . str_repeat( 'x', 248 ),
str_repeat( 'x', 252 ),
// interwiki prefix
'localtestiw: #anchor',
+ 'localtestiw:',
'localtestiw:foo',
'localtestiw: foo # anchor',
'localtestiw: Talk: Sandbox # anchor',
'remotetestiw: Talk: # anchor',
'remotetestiw: #bar',
'remotetestiw: Talk:',
- 'remotetestiw: Talk: Foo'
+ 'remotetestiw: Talk: Foo',
+ 'localtestiw:remotetestiw:',
+ 'localtestiw:remotetestiw:foo'
) as $text ) {
$this->assertInstanceOf( 'Title', Title::newFromText( $text ), "Valid: $text" );
}
'Category: ',
'Category: #bar',
// interwiki prefix
- 'localtestiw:',
'localtestiw: Talk: # anchor',
'localtestiw: Talk:'
) as $text ) {
} else {
$par = null;
}
- $this->assertEquals( $expectedParam, $par, "Bug 31100 regression check: Title->fixSpecialName() should preserve parameter" );
+ $this->assertEquals(
+ $expectedParam,
+ $par,
+ "Bug 31100 regression check: Title->fixSpecialName() should preserve parameter"
+ );
}
public static function provideBug31100() {
$allowableness = $expected
? " should be allowed"
: " should NOT be allowed";
- $this->assertEquals( $expected, $errors, "User action '$action' on [[$source]] $allowableness." );
+ $this->assertEquals(
+ $expected,
+ $errors,
+ "User action '$action' on [[$source]] $allowableness."
+ );
} else {
$errors = $this->flattenErrorsArray( $errors );
foreach ( (array)$expected as $error ) {
* @dataProvider provideGetPageViewLanguage
* @covers Title::getPageViewLanguage
*/
- public function testGetPageViewLanguage( $expected, $titleText, $contLang, $lang, $variant, $msg = '' ) {
+ public function testGetPageViewLanguage( $expected, $titleText, $contLang,
+ $lang, $variant, $msg = ''
+ ) {
global $wgLanguageCode, $wgContLang, $wgLang, $wgDefaultLanguageVariant, $wgAllowUserJs;
// Setup environnement for this test
/**
* @dataProvider provideGetFragment
*
- * @param $full
- * @param $fragment
+ * @param string $full
+ * @param string $fragment
*/
public function testGetFragment( $full, $fragment ) {
$title = Title::newFromText( $full );