summaryrefslogtreecommitdiff
path: root/tests/phpunit/includes/BlockTest.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2015-06-04 07:31:04 +0200
committerPierre Schmitz <pierre@archlinux.de>2015-06-04 07:58:39 +0200
commitf6d65e533c62f6deb21342d4901ece24497b433e (patch)
treef28adf0362d14bcd448f7b65a7aaf38650f923aa /tests/phpunit/includes/BlockTest.php
parentc27b2e832fe25651ef2410fae85b41072aae7519 (diff)
Update to MediaWiki 1.25.1
Diffstat (limited to 'tests/phpunit/includes/BlockTest.php')
-rw-r--r--tests/phpunit/includes/BlockTest.php12
1 files changed, 7 insertions, 5 deletions
diff --git a/tests/phpunit/includes/BlockTest.php b/tests/phpunit/includes/BlockTest.php
index b248d24e..19741621 100644
--- a/tests/phpunit/includes/BlockTest.php
+++ b/tests/phpunit/includes/BlockTest.php
@@ -133,6 +133,7 @@ class BlockTest extends MediaWikiLangTestCase {
$username = 'BlockedUserToCreateAccountWith';
$u = User::newFromName( $username );
$u->setPassword( 'NotRandomPass' );
+ $u->setId( 14146 );
$u->addToDatabase();
unset( $u );
@@ -200,6 +201,12 @@ class BlockTest extends MediaWikiLangTestCase {
$oldBlock->delete();
}
+ // Local perspective (blockee on current wiki)...
+ $user = User::newFromName( 'UserOnForeignWiki' );
+ $user->addToDatabase();
+ // Set user ID to match the test value
+ $this->db->update( 'user', array( 'user_id' => 14146 ), array( 'user_id' => $user->getId() ) );
+
// Foreign perspective (blockee not on current wiki)...
$block = new Block(
/* $address */ 'UserOnForeignWiki',
@@ -221,11 +228,6 @@ class BlockTest extends MediaWikiLangTestCase {
$res = $block->insert( $this->db );
$this->assertTrue( (bool)$res['id'], 'Block succeeded' );
- // Local perspective (blockee on current wiki)...
- $user = User::newFromName( 'UserOnForeignWiki' );
- $user->addToDatabase();
- // Set user ID to match the test value
- $this->db->update( 'user', array( 'user_id' => 14146 ), array( 'user_id' => $user->getId() ) );
$user = null; // clear
$block = Block::newFromID( $res['id'] );