Fix some of the weird freaky interaction between ApiBlockTest and BlockTest.
authorChad Horohoe <demon@users.mediawiki.org>
Fri, 3 Jun 2011 06:22:18 +0000 (06:22 +0000)
committerChad Horohoe <demon@users.mediawiki.org>
Fri, 3 Jun 2011 06:22:18 +0000 (06:22 +0000)
* 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
tests/phpunit/includes/api/ApiBlockTest.php

index b751703..58e0507 100644 (file)
@@ -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");
                
        }
index b90e77b..11953d7 100644 (file)
@@ -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');