The global config $wgBlockDisablesLogin can override certain block flags
if true, causing some tests to fail. Set it to false for these tests.
Change-Id: I497ef07bd34a1e458fd9692ef4874474e61151c8
* @covers Block::appliesToTitle
*/
public function testAppliesToTitleReturnsTrueOnSitewideBlock() {
* @covers Block::appliesToTitle
*/
public function testAppliesToTitleReturnsTrueOnSitewideBlock() {
+ $this->setMwGlobals( [
+ 'wgBlockDisablesLogin' => false,
+ ] );
$user = $this->getTestUser()->getUser();
$block = new Block( [
'expiry' => wfTimestamp( TS_MW, wfTimestamp() + ( 40 * 60 * 60 ) ),
$user = $this->getTestUser()->getUser();
$block = new Block( [
'expiry' => wfTimestamp( TS_MW, wfTimestamp() + ( 40 * 60 * 60 ) ),
* @covers Block::appliesToTitle
*/
public function testAppliesToTitleOnPartialBlock() {
* @covers Block::appliesToTitle
*/
public function testAppliesToTitleOnPartialBlock() {
+ $this->setMwGlobals( [
+ 'wgBlockDisablesLogin' => false,
+ ] );
$user = $this->getTestUser()->getUser();
$block = new Block( [
'expiry' => wfTimestamp( TS_MW, wfTimestamp() + ( 40 * 60 * 60 ) ),
$user = $this->getTestUser()->getUser();
$block = new Block( [
'expiry' => wfTimestamp( TS_MW, wfTimestamp() + ( 40 * 60 * 60 ) ),
* @covers Block::appliesToPage
*/
public function testAppliesToReturnsTrueOnSitewideBlock() {
* @covers Block::appliesToPage
*/
public function testAppliesToReturnsTrueOnSitewideBlock() {
+ $this->setMwGlobals( [
+ 'wgBlockDisablesLogin' => false,
+ ] );
$user = $this->getTestUser()->getUser();
$block = new Block( [
'expiry' => wfTimestamp( TS_MW, wfTimestamp() + ( 40 * 60 * 60 ) ),
$user = $this->getTestUser()->getUser();
$block = new Block( [
'expiry' => wfTimestamp( TS_MW, wfTimestamp() + ( 40 * 60 * 60 ) ),
* @covers Block::appliesToPage
*/
public function testAppliesToPageOnPartialPageBlock() {
* @covers Block::appliesToPage
*/
public function testAppliesToPageOnPartialPageBlock() {
+ $this->setMwGlobals( [
+ 'wgBlockDisablesLogin' => false,
+ ] );
$user = $this->getTestUser()->getUser();
$block = new Block( [
'expiry' => wfTimestamp( TS_MW, wfTimestamp() + ( 40 * 60 * 60 ) ),
$user = $this->getTestUser()->getUser();
$block = new Block( [
'expiry' => wfTimestamp( TS_MW, wfTimestamp() + ( 40 * 60 * 60 ) ),
* @covers Block::appliesToNamespace
*/
public function testAppliesToNamespaceOnPartialNamespaceBlock() {
* @covers Block::appliesToNamespace
*/
public function testAppliesToNamespaceOnPartialNamespaceBlock() {
+ $this->setMwGlobals( [
+ 'wgBlockDisablesLogin' => false,
+ ] );
$user = $this->getTestUser()->getUser();
$block = new Block( [
'expiry' => wfTimestamp( TS_MW, wfTimestamp() + ( 40 * 60 * 60 ) ),
$user = $this->getTestUser()->getUser();
$block = new Block( [
'expiry' => wfTimestamp( TS_MW, wfTimestamp() + ( 40 * 60 * 60 ) ),
* @covers Block::prevents
*/
public function testBlockAllowsPurge() {
* @covers Block::prevents
*/
public function testBlockAllowsPurge() {
+ $this->setMwGlobals( [
+ 'wgBlockDisablesLogin' => false,
+ ] );
$block = new Block();
$this->assertFalse( $block->prevents( 'purge' ) );
}
$block = new Block();
$this->assertFalse( $block->prevents( 'purge' ) );
}
* @covers ::rowToRestriction
*/
public function testLoadMultipleRestrictions() {
* @covers ::rowToRestriction
*/
public function testLoadMultipleRestrictions() {
+ $this->setMwGlobals( [
+ 'wgBlockDisablesLogin' => false,
+ ] );
$block = $this->insertBlock();
$pageFoo = $this->getExistingTestPage( 'Foo' );
$block = $this->insertBlock();
$pageFoo = $this->getExistingTestPage( 'Foo' );
$expectedResult,
$reason
) {
$expectedResult,
$reason
) {
+ $this->setMwGlobals( [
+ 'wgBlockDisablesLogin' => false,
+ ] );
$this->setGroupPermissions( 'sysop', 'unblockself', true );
$this->setGroupPermissions( 'user', 'block', true );
// Getting errors about creating users in db in provider.
$this->setGroupPermissions( 'sysop', 'unblockself', true );
$this->setGroupPermissions( 'user', 'block', true );
// Getting errors about creating users in db in provider.