Merge "Generate bundled page-linked notifications in test script"

This commit is contained in:
jenkins-bot 2016-02-13 20:28:54 +00:00 committed by Gerrit Code Review
commit 3068f25bb9

View file

@ -138,13 +138,8 @@ class GenerateSampleNotifications extends Maintenance {
}
private function generatePageLink( User $user, User $agent ) {
$pageBeingMentioned = $this->generateNewPageTitle();
$this->addToPageContent( $pageBeingMentioned, $user, "this is a new page" );
$pageMentioning = $this->generateNewPageTitle();
$content = "checkout [[{$pageBeingMentioned->getPrefixedText()}]]!";
$this->output( "{$agent->getName()} is linking to {$pageBeingMentioned->getPrefixedText()} from {$pageMentioning->getPrefixedText()}\n" );
$this->addToPageContent( $pageMentioning, $agent, $content );
$this->generateOnePageLink( $user, $agent );
$this->generateMultiplePageLinks( $user, $agent );
}
private function generateNewPageTitle() {
@ -256,7 +251,27 @@ class GenerateSampleNotifications extends Maintenance {
),
)
);
}
private function generateOnePageLink( User $user, User $agent ) {
$pageBeingLinked = $this->generateNewPageTitle();
$this->addToPageContent( $pageBeingLinked, $user, "this is a new page" );
$pageLinking = $this->generateNewPageTitle();
$content = "checkout [[{$pageBeingLinked->getPrefixedText()}]]!";
$this->output( "{$agent->getName()} is linking to {$pageBeingLinked->getPrefixedText()} from {$pageLinking->getPrefixedText()}\n" );
$this->addToPageContent( $pageLinking, $agent, $content );
}
private function generateMultiplePageLinks( User $user, User $agent ) {
$pageBeingLinked = $this->generateNewPageTitle();
$this->addToPageContent( $pageBeingLinked, $user, "this is a new page" );
$content = "checkout [[{$pageBeingLinked->getPrefixedText()}]]!";
$this->output( "{$agent->getName()} is linking to {$pageBeingLinked->getPrefixedText()} from multiple pages\n" );
$this->addToPageContent( $this->generateNewPageTitle(), $agent, $content );
$this->addToPageContent( $this->generateNewPageTitle(), $agent, $content );
$this->addToPageContent( $this->generateNewPageTitle(), $agent, $content );
}
}