From: Matthew Flaschen Date: Fri, 27 Feb 2015 05:35:08 +0000 (-0500) Subject: Fix testGetCanonicalName PHPUnit test: X-Git-Tag: 1.31.0-rc.0~12254^2 X-Git-Url: https://git.cyclocoop.org/%28%28?a=commitdiff_plain;h=e980ec63fdc84a6cae5589d87dcc250062ce6e45;p=lhc%2Fweb%2Fwiklou.git Fix testGetCanonicalName PHPUnit test: * assertEquals takes expected, prior to actual https://phpunit.de/manual/3.7/en/writing-tests-for-phpunit.html#writing-tests-for-phpunit.assertions.assertEquals * ' trailing space ' test was failing with wgCapitalLinks false. Since the test is not about that, I changed it to ' Trailing space '. The alternative would be to force wgCapitalLinks to true with setMwGlobals or skip the test if it's true. Change-Id: I677273045bdabb6248ffe2c2f003a3673b3fa51c --- diff --git a/tests/phpunit/includes/UserTest.php b/tests/phpunit/includes/UserTest.php index c3cb193720..860529e152 100644 --- a/tests/phpunit/includes/UserTest.php +++ b/tests/phpunit/includes/UserTest.php @@ -332,8 +332,8 @@ class UserTest extends MediaWikiTestCase { public function testGetCanonicalName( $name, $expectedArray, $msg ) { foreach ( $expectedArray as $validate => $expected ) { $this->assertEquals( - User::getCanonicalName( $name, $validate === 'false' ? false : $validate ), $expected, + User::getCanonicalName( $name, $validate === 'false' ? false : $validate ), $msg . ' (' . $validate . ')' ); } @@ -341,7 +341,7 @@ class UserTest extends MediaWikiTestCase { public static function provideGetCanonicalName() { return array( - array( ' trailing space ', array( 'creatable' => 'Trailing space' ), 'Trailing spaces' ), + array( ' Trailing space ', array( 'creatable' => 'Trailing space' ), 'Trailing spaces' ), // @todo FIXME: Maybe the creatable name should be 'Talk:Username' or false to reject? array( 'Talk:Username', array( 'creatable' => 'Username', 'usable' => 'Username', 'valid' => 'Username', 'false' => 'Talk:Username' ), 'Namespace prefix' ),