Merge "Add support for 'hu-formal'"
[lhc/web/wiklou.git] / tests / phpunit / includes / BlockTest.php
index 70715e2..19780a6 100644 (file)
@@ -35,6 +35,7 @@ class BlockTest extends MediaWikiLangTestCase {
                $blockOptions = [
                        'address' => $user->getName(),
                        'user' => $user->getId(),
+                       'by' => $this->getTestSysop()->getUser()->getId(),
                        'reason' => 'Parce que',
                        'expiry' => time() + 100500,
                ];
@@ -81,6 +82,7 @@ class BlockTest extends MediaWikiLangTestCase {
 
        /**
         * per T28425
+        * @covers Block::__construct
         */
        public function testBug26425BlockTimestampDefaultsToTime() {
                $user = $this->getUserForBlocking();
@@ -173,7 +175,7 @@ class BlockTest extends MediaWikiLangTestCase {
                );
 
                $this->assertInstanceOf(
-                       'Block',
+                       Block::class,
                        $userBlock,
                        "'$username' block block object should be existent"
                );
@@ -366,6 +368,9 @@ class BlockTest extends MediaWikiLangTestCase {
                $this->assertEquals( $exResult, $block->mReason, 'Correct block type for XFF header ' . $xff );
        }
 
+       /**
+        * @covers Block::__construct
+        */
        public function testDeprecatedConstructor() {
                $this->hideDeprecated( 'Block::__construct with multiple arguments' );
                $username = 'UnthinkablySecretRandomUsername';
@@ -389,7 +394,7 @@ class BlockTest extends MediaWikiLangTestCase {
                $block = new Block(
                        /* address */ $username,
                        /* user */ 0,
-                       /* by */ 0,
+                       /* by */ $this->getTestSysop()->getUser()->getId(),
                        /* reason */ $reason,
                        /* timestamp */ 0,
                        /* auto */ false,
@@ -418,6 +423,11 @@ class BlockTest extends MediaWikiLangTestCase {
                );
        }
 
+       /**
+        * @covers Block::getSystemBlockType
+        * @covers Block::insert
+        * @covers Block::doAutoblock
+        */
        public function testSystemBlocks() {
                $user = $this->getUserForBlocking();
                $this->addBlockForUser( $user );