] );
// 1. Log in a test user, and block them.
- $userBlocker = $this->getTestSysop()->getUser();
$user1tmp = $this->getTestUser()->getUser();
$request1 = new FauxRequest();
$request1->getSession()->setUser( $user1tmp );
] );
$block->setBlocker( $this->getTestSysop()->getUser() );
$block->setTarget( $user1tmp );
- $block->setBlocker( $userBlocker );
$res = $block->insert();
$this->assertTrue( (bool)$res['id'], 'Failed to insert block' );
$user1 = User::newFromSession( $request1 );
] );
// 1. Log in a test user, and block them.
- $userBlocker = $this->getTestSysop()->getUser();
$testUser = $this->getTestUser()->getUser();
$request1 = new FauxRequest();
$request1->getSession()->setUser( $testUser );
$block = new Block( [ 'enableAutoblock' => true ] );
$block->setBlocker( $this->getTestSysop()->getUser() );
$block->setTarget( $testUser );
- $block->setBlocker( $userBlocker );
$res = $block->insert();
$this->assertTrue( (bool)$res['id'], 'Failed to insert block' );
$user = User::newFromSession( $request1 );
] );
// 1. Log in a test user, and block them indefinitely.
- $userBlocker = $this->getTestSysop()->getUser();
$user1Tmp = $this->getTestUser()->getUser();
$request1 = new FauxRequest();
$request1->getSession()->setUser( $user1Tmp );
$block = new Block( [ 'enableAutoblock' => true, 'expiry' => 'infinity' ] );
$block->setBlocker( $this->getTestSysop()->getUser() );
$block->setTarget( $user1Tmp );
- $block->setBlocker( $userBlocker );
$res = $block->insert();
$this->assertTrue( (bool)$res['id'], 'Failed to insert block' );
$user1 = User::newFromSession( $request1 );
] );
// 1. Log in a blocked test user.
- $userBlocker = $this->getTestSysop()->getUser();
$user1tmp = $this->getTestUser()->getUser();
$request1 = new FauxRequest();
$request1->getSession()->setUser( $user1tmp );
$block = new Block( [ 'enableAutoblock' => true ] );
$block->setBlocker( $this->getTestSysop()->getUser() );
$block->setTarget( $user1tmp );
- $block->setBlocker( $userBlocker );
$res = $block->insert();
$this->assertTrue( (bool)$res['id'], 'Failed to insert block' );
$user1 = User::newFromSession( $request1 );
] );
// 1. Log in a blocked test user.
- $userBlocker = $this->getTestSysop()->getUser();
$user1tmp = $this->getTestUser()->getUser();
$request1 = new FauxRequest();
$request1->getSession()->setUser( $user1tmp );
$block = new Block( [ 'enableAutoblock' => true ] );
$block->setBlocker( $this->getTestSysop()->getUser() );
$block->setTarget( $user1tmp );
- $block->setBlocker( $userBlocker );
$res = $block->insert();
$this->assertTrue( (bool)$res['id'], 'Failed to insert block' );
$user1 = User::newFromSession( $request1 );