if ( !isset( $this->userUser ) || !( $this->userUser instanceof User ) ) {
$this->userUser = User::newFromName( $this->userName );
- if ( !$this->userUser->getID() ) {
+ if ( !$this->userUser->getId() ) {
$this->userUser = User::createNew( $this->userName, [
"email" => "test@example.com",
"real_name" => "Test User" ] );
}
$this->altUser = User::newFromName( $this->altUserName );
- if ( !$this->altUser->getID() ) {
+ if ( !$this->altUser->getId() ) {
$this->altUser = User::createNew( $this->altUserName, [
"email" => "alttest@example.com",
"real_name" => "Test User Alt" ] );
$this->setUserPerm( [ "createpage" ] );
$this->setTitle( NS_MAIN, "test page" );
$this->title->mTitleProtection['permission'] = '';
- $this->title->mTitleProtection['user'] = $this->user->getID();
+ $this->title->mTitleProtection['user'] = $this->user->getId();
$this->title->mTitleProtection['expiry'] = 'infinity';
$this->title->mTitleProtection['reason'] = 'test';
$this->title->mCascadeRestriction = false;
# $action != 'read' && $action != 'createaccount' && $user->isBlockedFrom( $this )
# $user->blockedFor() == ''
# $user->mBlock->mExpiry == 'infinity'
+
+ $this->user->mBlockedby = $this->user->getName();
+ $this->user->mBlock = new Block( [
+ 'address' => '127.0.8.1',
+ 'by' => $this->user->getId(),
+ 'reason' => 'no reason given',
+ 'timestamp' => $now,
+ 'auto' => false,
+ 'expiry' => 10,
+ 'systemBlock' => 'test',
+ ] );
+ $this->assertEquals( [ [ 'systemblockedtext',
+ '[[User:Useruser|Useruser]]', 'no reason given', '127.0.0.1',
+ 'Useruser', 'test', '23:00, 31 December 1969', '127.0.8.1',
+ $wgLang->timeanddate( wfTimestamp( TS_MW, $now ), true ) ] ],
+ $this->title->getUserPermissionsErrors( 'move-target', $this->user ) );
}
}