Merge "Remove rcenhancedfilters from $wgDefaultUserOptions"
[lhc/web/wiklou.git] / tests / phpunit / includes / BlockTest.php
index 61e3e7c..3dc5e78 100644 (file)
@@ -175,21 +175,31 @@ class BlockTest extends MediaWikiLangTestCase {
                                '0.0.0.0',
                                '0.0.0.0'
                        ],
-                       'Blocks to wide IPv6 range and IP' => [
-                               [ '0:0:0:0:0:0:0:0/19', '0:0:0:0:0:0:0:0' ],
-                               '0:0:0:0:0:0:0:0',
-                               '0:0:0:0:0:0:0:0'
-                       ],
                        'Blocks to narrow IPv4 range and IP' => [
                                [ '0.0.0.0/31', '0.0.0.0' ],
                                '0.0.0.0',
                                '0.0.0.0'
                        ],
+                       'Blocks to wide IPv6 range and IP' => [
+                               [ '0:0:0:0:0:0:0:0/19', '0:0:0:0:0:0:0:0' ],
+                               '0:0:0:0:0:0:0:0',
+                               '0:0:0:0:0:0:0:0'
+                       ],
                        'Blocks to narrow IPv6 range and IP' => [
                                [ '0:0:0:0:0:0:0:0/127', '0:0:0:0:0:0:0:0' ],
                                '0:0:0:0:0:0:0:0',
                                '0:0:0:0:0:0:0:0'
                        ],
+                       'Blocks to wide IPv6 range and IP, large numbers' => [
+                               [ '2000:DEAD:BEEF:A:0:0:0:0/19', '2000:DEAD:BEEF:A:0:0:0:0' ],
+                               '2000:DEAD:BEEF:A:0:0:0:0',
+                               '2000:DEAD:BEEF:A:0:0:0:0'
+                       ],
+                       'Blocks to narrow IPv6 range and IP, large numbers' => [
+                               [ '2000:DEAD:BEEF:A:0:0:0:0/127', '2000:DEAD:BEEF:A:0:0:0:0' ],
+                               '2000:DEAD:BEEF:A:0:0:0:0',
+                               '2000:DEAD:BEEF:A:0:0:0:0'
+                       ],
                ];
        }
 
@@ -437,43 +447,6 @@ class BlockTest extends MediaWikiLangTestCase {
                );
        }
 
-       /**
-        * @covers Block::getSystemBlockType
-        * @covers Block::insert
-        * @covers Block::doAutoblock
-        */
-       public function testSystemBlocks() {
-               $user = $this->getUserForBlocking();
-               $this->addBlockForUser( $user );
-
-               $blockOptions = [
-                       'address' => $user->getName(),
-                       'reason' => 'test system block',
-                       'timestamp' => wfTimestampNow(),
-                       'expiry' => $this->db->getInfinity(),
-                       'byText' => 'MediaWiki default',
-                       'systemBlock' => 'test',
-                       'enableAutoblock' => true,
-               ];
-               $block = new Block( $blockOptions );
-
-               $this->assertSame( 'test', $block->getSystemBlockType() );
-
-               try {
-                       $block->insert();
-                       $this->fail( 'Expected exception not thrown' );
-               } catch ( MWException $ex ) {
-                       $this->assertSame( 'Cannot insert a system block into the database', $ex->getMessage() );
-               }
-
-               try {
-                       $block->doAutoblock( '192.0.2.2' );
-                       $this->fail( 'Expected exception not thrown' );
-               } catch ( MWException $ex ) {
-                       $this->assertSame( 'Cannot autoblock from a system block', $ex->getMessage() );
-               }
-       }
-
        /**
         * @covers Block::newFromRow
         */