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); return $update; }
protected function assertRecentChangeByCategorization(Title $pageTitle, ParserOutput $parserOutput, Title $categoryTitle, $expectedRows) { $update = new LinksUpdate($pageTitle, $parserOutput); $revision = Revision::newFromTitle($pageTitle); $update->setRevision($revision); $update->beginTransaction(); $update->doUpdate(); $update->commitTransaction(); $this->assertSelect('recentchanges', 'rc_title, rc_comment', array('rc_type' => RC_CATEGORIZE, 'rc_namespace' => NS_CATEGORY, 'rc_title' => $categoryTitle->getDBkey()), $expectedRows); }