);
}
- function setUp() {
+ protected function setUp() {
+ parent::setUp();
$dbw = wfGetDB( DB_MASTER );
$dbw->replace(
'interwiki',
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(
#@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 );
}