From: Chad Horohoe Date: Fri, 3 Jun 2011 06:22:18 +0000 (+0000) Subject: Fix some of the weird freaky interaction between ApiBlockTest and BlockTest. X-Git-Tag: 1.31.0-rc.0~29747 X-Git-Url: http://git.cyclocoop.org/ecrire?a=commitdiff_plain;h=cb569f094f947aa769012a5be468837cf365c173;p=lhc%2Fweb%2Fwiklou.git Fix some of the weird freaky interaction between ApiBlockTest and BlockTest. * By using the same summary for both, we allow both sets of tests to pass with --filter Block * Just testing includes/BlockTest.php still passes --- diff --git a/tests/phpunit/includes/BlockTest.php b/tests/phpunit/includes/BlockTest.php index b751703e2f..58e050793d 100644 --- a/tests/phpunit/includes/BlockTest.php +++ b/tests/phpunit/includes/BlockTest.php @@ -2,9 +2,10 @@ /** * @group Database - * @group Broken */ -class BlockTest extends MediaWikiLangTestCase { +class BlockTest extends MediaWikiTestCase { + + const REASON = "Some reason"; private $block, $madeAt; @@ -29,7 +30,7 @@ class BlockTest extends MediaWikiLangTestCase { } $this->block = new Block( 'UTBlockee', 1, 0, - 'Parce que' + self::REASON ); $this->madeAt = wfTimestamp( TS_MW ); @@ -55,7 +56,7 @@ class BlockTest extends MediaWikiLangTestCase { // $this->dumpBlocks(); $this->assertTrue( $this->block->equals( Block::newFromTarget('UTBlockee') ), "newFromTarget() returns the same block as the one that was made"); - + $this->assertTrue( $this->block->equals( Block::newFromID( $this->blockId ) ), "newFromID() returns the same block as the one that was made"); } diff --git a/tests/phpunit/includes/api/ApiBlockTest.php b/tests/phpunit/includes/api/ApiBlockTest.php index b90e77b642..11953d7faa 100644 --- a/tests/phpunit/includes/api/ApiBlockTest.php +++ b/tests/phpunit/includes/api/ApiBlockTest.php @@ -49,7 +49,7 @@ class ApiBlockTest extends ApiTestSetup { $data = $this->doApiRequest( array( 'action' => 'block', 'user' => 'UTBlockee', - 'reason' => 'Some reason', + 'reason' => BlockTest::REASON, 'token' => $pageinfo['blocktoken'] ), $data ); $block = Block::newFromTarget('UTBlockee');