18 $title = $page->getTitle();
23 'titles' =>
$title->getText(),
26 $this->assertArrayHasKey(
'query', $data );
27 $this->assertArrayHasKey(
'pages', $data[
'query'] );
28 $this->assertArrayHasKey( $page->getId(), $data[
'query'][
'pages'] );
30 $info = $data[
'query'][
'pages'][$page->getId()];
31 $this->assertSame( $page->getId(), $info[
'pageid'] );
32 $this->assertSame(
$title->getNamespace(), $info[
'ns'] );
33 $this->assertSame(
$title->getText(), $info[
'title'] );
34 $this->assertSame(
$title->getContentModel(), $info[
'contentmodel'] );
35 $this->assertSame(
$title->getPageLanguage()->getCode(), $info[
'pagelanguage'] );
36 $this->assertSame(
$title->getPageLanguage()->getHtmlCode(), $info[
'pagelanguagehtmlcode'] );
37 $this->assertSame(
$title->getPageLanguage()->getDir(), $info[
'pagelanguagedir'] );
38 $this->assertSame(
wfTimestamp( TS_ISO_8601,
$title->getTouched() ), $info[
'touched'] );
39 $this->assertSame(
$title->getLatestRevID(), $info[
'lastrevid'] );
40 $this->assertSame(
$title->getLength(), $info[
'length'] );
41 $this->assertSame(
$title->isNewPage(), $info[
'new'] );
42 $this->assertArrayNotHasKey(
'actions', $info );
51 $title = $page->getTitle();
56 'titles' =>
$title->getText(),
57 'intestactions' =>
'edit'
60 $this->assertArrayHasKey(
'query', $data );
61 $this->assertArrayHasKey(
'pages', $data[
'query'] );
62 $this->assertArrayHasKey( $page->getId(), $data[
'query'][
'pages'] );
64 $info = $data[
'query'][
'pages'][$page->getId()];
65 $this->assertArrayHasKey(
'actions', $info );
66 $this->assertArrayHasKey(
'edit', $info[
'actions'] );
67 $this->assertTrue( $info[
'actions'][
'edit'] );
76 $title = $page->getTitle();
81 'titles' =>
$title->getText(),
82 'intestactions' =>
'edit',
83 'intestactionsdetail' =>
'full',
86 $this->assertArrayHasKey(
'query', $data );
87 $this->assertArrayHasKey(
'pages', $data[
'query'] );
88 $this->assertArrayHasKey( $page->getId(), $data[
'query'][
'pages'] );
90 $info = $data[
'query'][
'pages'][$page->getId()];
91 $this->assertArrayHasKey(
'actions', $info );
92 $this->assertArrayHasKey(
'edit', $info[
'actions'] );
93 $this->assertInternalType(
'array', $info[
'actions'][
'edit'] );
94 $this->assertSame( [], $info[
'actions'][
'edit'] );
105 $block = new \Block( [
106 'address' => $badActor->getName(),
107 'user' => $badActor->getId(),
108 'by' => $sysop->getId(),
109 'expiry' =>
'infinity',
111 'enableAutoblock' =>
true,
117 $title = $page->getTitle();
122 'titles' =>
$title->getText(),
123 'intestactions' =>
'edit',
124 'intestactionsdetail' =>
'full',
125 ],
null,
false, $badActor );
129 $this->assertArrayHasKey(
'query', $data );
130 $this->assertArrayHasKey(
'pages', $data[
'query'] );
131 $this->assertArrayHasKey( $page->getId(), $data[
'query'][
'pages'] );
133 $info = $data[
'query'][
'pages'][$page->getId()];
134 $this->assertArrayHasKey(
'actions', $info );
135 $this->assertArrayHasKey(
'edit', $info[
'actions'] );
136 $this->assertInternalType(
'array', $info[
'actions'][
'edit'] );
137 $this->assertArrayHasKey( 0, $info[
'actions'][
'edit'] );
138 $this->assertArrayHasKey(
'code', $info[
'actions'][
'edit'][0] );
139 $this->assertSame(
'blocked', $info[
'actions'][
'edit'][0][
'code'] );
140 $this->assertArrayHasKey(
'data', $info[
'actions'][
'edit'][0] );
141 $this->assertArrayHasKey(
'blockinfo', $info[
'actions'][
'edit'][0][
'data'] );
142 $this->assertArrayHasKey(
'blockid', $info[
'actions'][
'edit'][0][
'data'][
'blockinfo'] );
143 $this->assertSame( $block->getId(), $info[
'actions'][
'edit'][0][
'data'][
'blockinfo'][
'blockid'] );