PrefixSearchTest: Move insertPage() from setUp() to addDBData()
authorTimo Tijhof <krinklemail@gmail.com>
Mon, 23 Mar 2015 05:29:55 +0000 (05:29 +0000)
committerUmherirrender <umherirrender_de.wp@web.de>
Wed, 25 Mar 2015 19:10:40 +0000 (19:10 +0000)
Doesn't change the semantics much since run() calls addDBData()
right before setUp(), but these belong addDBData() per the
documentation of setUp().

Change-Id: I304a0aff1fc6b2f0541b3dc3c9e3527772c8f91c

tests/phpunit/includes/PrefixSearchTest.php

index e737056..d63541b 100644 (file)
@@ -5,6 +5,28 @@
  */
 class PrefixSearchTest extends MediaWikiLangTestCase {
 
+       public function addDBData() {
+               $this->insertPage( 'Sandbox' );
+               $this->insertPage( 'Bar' );
+               $this->insertPage( 'Example' );
+               $this->insertPage( 'Example Bar' );
+               $this->insertPage( 'Example Foo' );
+               $this->insertPage( 'Example Foo/Bar' );
+               $this->insertPage( 'Example/Baz' );
+               $this->insertPage( 'Redirect test', '#REDIRECT [[Redirect Test]]' );
+               $this->insertPage( 'Redirect Test' );
+               $this->insertPage( 'Redirect Test Worse Result' );
+               $this->insertPage( 'Redirect test2', '#REDIRECT [[Redirect Test2]]' );
+               $this->insertPage( 'Redirect TEST2', '#REDIRECT [[Redirect Test2]]' );
+               $this->insertPage( 'Redirect Test2' );
+               $this->insertPage( 'Redirect Test2 Worse Result' );
+
+               $this->insertPage( 'Talk:Sandbox' );
+               $this->insertPage( 'Talk:Example' );
+
+               $this->insertPage( 'User:Example' );
+       }
+
        protected function setUp() {
                parent::setUp();
 
@@ -12,8 +34,6 @@ class PrefixSearchTest extends MediaWikiLangTestCase {
                        $this->markTestSkipped( 'Main namespace does not support wikitext.' );
                }
 
-               $this->insertPages();
-
                // Avoid special pages from extensions interferring with the tests
                $this->setMwGlobals( 'wgSpecialPages', array() );
        }
@@ -33,28 +53,6 @@ class PrefixSearchTest extends MediaWikiLangTestCase {
                }
        }
 
-       public function insertPages() {
-               $this->insertPage( 'Sandbox' );
-               $this->insertPage( 'Bar' );
-               $this->insertPage( 'Example' );
-               $this->insertPage( 'Example Bar' );
-               $this->insertPage( 'Example Foo' );
-               $this->insertPage( 'Example Foo/Bar' );
-               $this->insertPage( 'Example/Baz' );
-               $this->insertPage( 'Redirect test', '#REDIRECT [[Redirect Test]]' );
-               $this->insertPage( 'Redirect Test' );
-               $this->insertPage( 'Redirect Test Worse Result' );
-               $this->insertPage( 'Redirect test2', '#REDIRECT [[Redirect Test2]]' );
-               $this->insertPage( 'Redirect TEST2', '#REDIRECT [[Redirect Test2]]' );
-               $this->insertPage( 'Redirect Test2' );
-               $this->insertPage( 'Redirect Test2 Worse Result' );
-
-               $this->insertPage( 'Talk:Sandbox' );
-               $this->insertPage( 'Talk:Example' );
-
-               $this->insertPage( 'User:Example' );
-       }
-
        public static function provideSearch() {
                return array(
                        array( array(