Merge "(bug 37755) Set robot meta tags for 'view source' pages"
[lhc/web/wiklou.git] / tests / phpunit / includes / LinksUpdateTest.php
index a50a223..7499272 100644 (file)
@@ -10,30 +10,36 @@ class LinksUpdateTest extends MediaWikiTestCase {
        function  __construct( $name = null, array $data = array(), $dataName = '' ) {
                parent::__construct( $name, $data, $dataName );
 
-               $this->tablesUsed = array_merge ( $this->tablesUsed,
-                                                                                       array( 'interwiki',
-
-                                                                                               'page_props',
-                                                                                               'pagelinks',
-                                                                                               'categorylinks',
-                                                                                               'langlinks',
-                                                                                               'externallinks',
-                                                                                               'imagelinks',
-                                                                                               'templatelinks',
-                                                                                               'iwlinks' ) );
+               $this->tablesUsed = array_merge( $this->tablesUsed,
+                       array(
+                               'interwiki',
+                               'page_props',
+                               'pagelinks',
+                               'categorylinks',
+                               'langlinks',
+                               'externallinks',
+                               'imagelinks',
+                               'templatelinks',
+                               'iwlinks'
+                       )
+               );
        }
 
-       function setUp() {
+       protected function setUp() {
+               parent::setUp();
                $dbw = wfGetDB( DB_MASTER );
-               $dbw->replace( 'interwiki',
-                                               array('iw_prefix'),
-                                               array( 'iw_prefix' => 'linksupdatetest',
-                                                      'iw_url' => 'http://testing.com/wiki/$1',
-                                                      'iw_api' => 'http://testing.com/w/api.php',
-                                                      'iw_local' => 0,
-                                                      'iw_trans' => 0,
-                                                      'iw_wikiid' => 'linksupdatetest',
-                                               ) );
+               $dbw->replace(
+                       'interwiki',
+                       array( 'iw_prefix' ),
+                       array(
+                               'iw_prefix' => 'linksupdatetest',
+                               'iw_url' => 'http://testing.com/wiki/$1',
+                               'iw_api' => 'http://testing.com/w/api.php',
+                               'iw_local' => 0,
+                               'iw_trans' => 0,
+                               'iw_wikiid' => 'linksupdatetest',
+                       )
+               );
        }
 
        protected function makeTitleAndParserOutput( $name, $id ) {
@@ -143,9 +149,10 @@ class LinksUpdateTest extends MediaWikiTestCase {
 
        #@todo: test recursive, too!
 
-       protected function assertLinksUpdate( Title $title, ParserOutput $parserOutput, $table, $fields, $condition, Array $expectedRows ) {
+       protected function assertLinksUpdate( Title $title, ParserOutput $parserOutput, $table, $fields, $condition, array $expectedRows ) {
                $update = new LinksUpdate( $title, $parserOutput );
 
+               //NOTE: make sure LinksUpdate does not generate warnings when called inside a transaction.
                $update->beginTransaction();
                $update->doUpdate();
                $update->commitTransaction();