Remove reliance on Block properties being public
[lhc/web/wiklou.git] / tests / phpunit / includes / specials / SpecialBlockTest.php
index 91f12f4..182ca0d 100644 (file)
@@ -91,7 +91,7 @@ class SpecialBlockTest extends SpecialPageTestBase {
                $this->assertSame( $block->isCreateAccountBlocked(), $fields['CreateAccount']['default'] );
                $this->assertSame( $block->isAutoblocking(), $fields['AutoBlock']['default'] );
                $this->assertSame( !$block->isUsertalkEditAllowed(), $fields['DisableUTEdit']['default'] );
-               $this->assertSame( $block->mReason, $fields['Reason']['default'] );
+               $this->assertSame( $block->getReason(), $fields['Reason']['default'] );
                $this->assertSame( 'infinite', $fields['Expiry']['default'] );
        }
 
@@ -179,7 +179,7 @@ class SpecialBlockTest extends SpecialPageTestBase {
                $this->assertTrue( $result );
 
                $block = Block::newFromTarget( $badActor );
-               $this->assertSame( $reason, $block->mReason );
+               $this->assertSame( $reason, $block->getReason() );
                $this->assertSame( $expiry, $block->getExpiry() );
        }
 
@@ -228,7 +228,7 @@ class SpecialBlockTest extends SpecialPageTestBase {
                $this->assertTrue( $result );
 
                $block = Block::newFromTarget( $badActor );
-               $this->assertSame( $reason, $block->mReason );
+               $this->assertSame( $reason, $block->getReason() );
                $this->assertSame( $expiry, $block->getExpiry() );
                $this->assertSame( '1', $block->isAutoblocking() );
        }
@@ -277,7 +277,7 @@ class SpecialBlockTest extends SpecialPageTestBase {
                $this->assertTrue( $result );
 
                $block = Block::newFromTarget( $badActor );
-               $this->assertSame( $reason, $block->mReason );
+               $this->assertSame( $reason, $block->getReason() );
                $this->assertSame( $expiry, $block->getExpiry() );
                $this->assertCount( 2, $block->getRestrictions() );
                $this->assertTrue( BlockRestriction::equals( $block->getRestrictions(), [
@@ -331,7 +331,7 @@ class SpecialBlockTest extends SpecialPageTestBase {
                $this->assertTrue( $result );
 
                $block = Block::newFromTarget( $badActor );
-               $this->assertSame( $reason, $block->mReason );
+               $this->assertSame( $reason, $block->getReason() );
                $this->assertSame( $expiry, $block->getExpiry() );
                $this->assertFalse( $block->isSitewide() );
                $this->assertCount( 2, $block->getRestrictions() );
@@ -347,7 +347,7 @@ class SpecialBlockTest extends SpecialPageTestBase {
                $this->assertTrue( $result );
 
                $block = Block::newFromTarget( $badActor );
-               $this->assertSame( $reason, $block->mReason );
+               $this->assertSame( $reason, $block->getReason() );
                $this->assertSame( $expiry, $block->getExpiry() );
                $this->assertFalse( $block->isSitewide() );
                $this->assertCount( 1, $block->getRestrictions() );
@@ -362,7 +362,7 @@ class SpecialBlockTest extends SpecialPageTestBase {
                $this->assertTrue( $result );
 
                $block = Block::newFromTarget( $badActor );
-               $this->assertSame( $reason, $block->mReason );
+               $this->assertSame( $reason, $block->getReason() );
                $this->assertSame( $expiry, $block->getExpiry() );
                $this->assertFalse( $block->isSitewide() );
                $this->assertCount( 0, $block->getRestrictions() );
@@ -374,7 +374,7 @@ class SpecialBlockTest extends SpecialPageTestBase {
                $this->assertTrue( $result );
 
                $block = Block::newFromTarget( $badActor );
-               $this->assertSame( $reason, $block->mReason );
+               $this->assertSame( $reason, $block->getReason() );
                $this->assertSame( $expiry, $block->getExpiry() );
                $this->assertTrue( $block->isSitewide() );
                $this->assertCount( 0, $block->getRestrictions() );