Remove references to non-existent 'execute' right in Title.php
[lhc/web/wiklou.git] / tests / phpunit / includes / LinksUpdateTest.php
index 09858b0..3325885 100644 (file)
@@ -25,7 +25,8 @@ class LinksUpdateTest extends MediaWikiTestCase {
                );
        }
 
-       function setUp() {
+       protected function setUp() {
+               parent::setUp();
                $dbw = wfGetDB( DB_MASTER );
                $dbw->replace(
                        'interwiki',
@@ -128,7 +129,7 @@ class LinksUpdateTest extends MediaWikiTestCase {
        public function testUpdate_langlinks() {
                list( $t, $po ) = $this->makeTitleAndParserOutput( "Testing", 111 );
 
-               $po->addLanguageLink( Title::newFromText( "en:Foo" ) );
+               $po->addLanguageLink( Title::newFromText( "en:Foo" )->getFullText() );
 
 
                $this->assertLinksUpdate( $t, $po, 'langlinks', 'll_lang, ll_title', 'll_from = 111', array(
@@ -148,10 +149,13 @@ 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();
 
                $this->assertSelect( $table, $fields, $condition, $expectedRows );
        }