From cb569f094f947aa769012a5be468837cf365c173 Mon Sep 17 00:00:00 2001 From: Chad Horohoe Date: Fri, 3 Jun 2011 06:22:18 +0000 Subject: [PATCH] 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 --- tests/phpunit/includes/BlockTest.php | 9 +++++---- tests/phpunit/includes/api/ApiBlockTest.php | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) 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'); -- 2.20.1