本文整理汇总了PHP中RecentChange::newForCategorization方法的典型用法代码示例。如果您正苦于以下问题:PHP RecentChange::newForCategorization方法的具体用法?PHP RecentChange::newForCategorization怎么用?PHP RecentChange::newForCategorization使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RecentChange
的用法示例。
在下文中一共展示了RecentChange::newForCategorization方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testHiddenCategoryChange
/**
* @dataProvider provideCategoryContent
* @covers RecentChange::newForCategorization
*/
public function testHiddenCategoryChange($isHidden)
{
$categoryTitle = Title::newFromText('CategoryPage', NS_CATEGORY);
$pageProps = $this->getMockPageProps();
$pageProps->expects($this->once())->method('getProperties')->with($categoryTitle, 'hiddencat')->will($this->returnValue($isHidden ? [$categoryTitle->getArticleID() => ''] : []));
$scopedOverride = PageProps::overrideInstance($pageProps);
$rc = RecentChange::newForCategorization('0', $categoryTitle, $this->user, $this->user_comment, $this->title, $categoryTitle->getLatestRevID(), $categoryTitle->getLatestRevID(), '0', false);
$this->assertEquals($isHidden, $rc->getParam('hidden-cat'));
ScopedCallback::consume($scopedOverride);
}
示例2: testCategorizeTypeParameter
public function testCategorizeTypeParameter()
{
$user = $this->getLoggedInTestUser();
$subjectTarget = new TitleValue(0, 'ApiQueryWatchlistIntegrationTestPage');
$categoryTarget = new TitleValue(NS_CATEGORY, 'ApiQueryWatchlistIntegrationTestCategory');
$this->doPageEdits($user, [['target' => $categoryTarget, 'content' => 'Some Content', 'summary' => 'Create the category'], ['target' => $subjectTarget, 'content' => 'Some Content [[Category:ApiQueryWatchlistIntegrationTestCategory]]t', 'summary' => 'Create the page and add it to the category']]);
$title = Title::newFromLinkTarget($subjectTarget);
$revision = Revision::newFromTitle($title);
$rc = RecentChange::newForCategorization($revision->getTimestamp(), Title::newFromLinkTarget($categoryTarget), $user, $revision->getComment(), $title, 0, $revision->getId(), null, false);
$rc->save();
$this->watchPages($user, [$subjectTarget, $categoryTarget]);
$result = $this->doListWatchlistRequest(['wlprop' => 'title', 'wltype' => 'categorize']);
$this->assertEquals([['type' => 'categorize', 'ns' => $categoryTarget->getNamespace(), 'title' => $this->getPrefixedText($categoryTarget)]], $this->getItemsFromApiResponse($result));
}