assertEquals is $expected, $actual, not $actual, $expected
authorReedy <reedy@wikimedia.org>
Wed, 18 Apr 2012 12:50:39 +0000 (13:50 +0100)
committerBrion Vibber <brion@pobox.com>
Wed, 18 Apr 2012 23:03:46 +0000 (16:03 -0700)
Fix Title related tests that are the wrong way round (noticed by Daniel Kinzler
when creating more tests, and wondering why phpunit was making error messages
that didn't make any sense!)

public static function assertEquals($expected, $actual, $message = '',
    $delta = 0, $maxDepth = 10, $canonicalize = FALSE, $ignoreCase = FALSE)

Change-Id: I09aeb7cb7edb8e486ccf2f54673f91cd9704cd3b

tests/phpunit/includes/TitleMethodsTest.php

index 2f1103e..badd040 100644 (file)
@@ -21,8 +21,8 @@ class TitleMethodsTest extends MediaWikiTestCase {
                $titleA = Title::newFromText( $titleA );
                $titleB = Title::newFromText( $titleB );
 
-               $this->assertEquals( $titleA->equals( $titleB ), $expectedBool );
-               $this->assertEquals( $titleB->equals( $titleA ), $expectedBool );
+               $this->assertEquals( $expectedBool, $titleA->equals( $titleB ) );
+               $this->assertEquals( $expectedBool, $titleB->equals( $titleA ) );
        }
 
        public function dataInNamespace() {
@@ -72,7 +72,7 @@ class TitleMethodsTest extends MediaWikiTestCase {
         */
        public function testHasSubjectNamespace( $title, $ns, $expectedBool ) {
                $title = Title::newFromText( $title );
-               $this->assertEquals( $title->hasSubjectNamespace( $ns ), $expectedBool );
+               $this->assertEquals( $expectedBool, $title->hasSubjectNamespace( $ns ) );
        }
 
 }