22 $title = Title::makeTitle( $ns, $dbKey );
24 foreach ( $pages as $page ) {
25 list( $bns, $bdbkey ) = $page;
26 $bpage = WikiPage::factory( Title::makeTitle( $bns, $bdbkey ) );
27 $content = ContentHandler::makeContent(
"[[{$title->getPrefixedText()}]]", $bpage->getTitle() );
28 $bpage->doEditContent( $content,
"test" );
31 $title->getBacklinkCache()->clear();
34 $title->getBacklinkCache()->getNumLinks(
'pagelinks' ),
35 'Correct number of backlinks'
40 $extraParams =
$job->getRootJobParams();
43 $this->assertEquals( 10, count( $jobs ),
'Correct number of sub-jobs' );
44 $this->assertEquals( $pages[0], current( $jobs[0]->params[
'pages'] ),
45 'First job is leaf job with proper title' );
46 $this->assertEquals( $pages[8], current( $jobs[8]->params[
'pages'] ),
47 'Last leaf job is leaf job with proper title' );
48 $this->assertEquals(
true, isset( $jobs[9]->params[
'recursive'] ),
49 'Last job is recursive sub-job' );
50 $this->assertEquals(
true, $jobs[9]->params[
'recursive'],
51 'Last job is recursive sub-job' );
52 $this->assertEquals(
true, is_array( $jobs[9]->params[
'range'] ),
53 'Last job is recursive sub-job' );
54 $this->assertEquals( $title->getPrefixedText(), $jobs[0]->getTitle()->getPrefixedText(),
55 'Base job title retainend in leaf job' );
56 $this->assertEquals( $title->getPrefixedText(), $jobs[9]->getTitle()->getPrefixedText(),
57 'Base job title retainend recursive sub-job' );
58 $this->assertEquals( $extraParams[
'rootJobSignature'], $jobs[0]->params[
'rootJobSignature'],
59 'Leaf job has root params' );
60 $this->assertEquals( $extraParams[
'rootJobSignature'], $jobs[9]->params[
'rootJobSignature'],
61 'Recursive sub-job has root params' );
67 [
'params' => $extraParams ]
70 $this->assertEquals( 10, count( $jobs2 ),
'Correct number of sub-jobs' );
71 $this->assertEquals( $pages[9], current( $jobs2[0]->params[
'pages'] ),
72 'First job is leaf job with proper title' );
73 $this->assertEquals( $pages[17], current( $jobs2[8]->params[
'pages'] ),
74 'Last leaf job is leaf job with proper title' );
75 $this->assertEquals(
true, isset( $jobs2[9]->params[
'recursive'] ),
76 'Last job is recursive sub-job' );
77 $this->assertEquals(
true, $jobs2[9]->params[
'recursive'],
78 'Last job is recursive sub-job' );
79 $this->assertEquals(
true, is_array( $jobs2[9]->params[
'range'] ),
80 'Last job is recursive sub-job' );
81 $this->assertEquals( $extraParams[
'rootJobSignature'], $jobs2[0]->params[
'rootJobSignature'],
82 'Leaf job has root params' );
83 $this->assertEquals( $extraParams[
'rootJobSignature'], $jobs2[9]->params[
'rootJobSignature'],
84 'Recursive sub-job has root params' );
90 [
'params' => $extraParams ]
93 $this->assertEquals( 2, count( $jobs3 ),
'Correct number of sub-jobs' );
94 $this->assertEquals( $pages[18], current( $jobs3[0]->params[
'pages'] ),
95 'First job is leaf job with proper title' );
96 $this->assertEquals( $extraParams[
'rootJobSignature'], $jobs3[0]->params[
'rootJobSignature'],
97 'Leaf job has root params' );
98 $this->assertEquals( $pages[19], current( $jobs3[1]->params[
'pages'] ),
99 'Last job is leaf job with proper title' );
100 $this->assertEquals( $extraParams[
'rootJobSignature'], $jobs3[1]->params[
'rootJobSignature'],
101 'Last leaf job has root params' );