2 namespace TYPO3\CMS\Frontend\Tests\Functional\Page;
18 use TYPO3\CMS\Core\Tests\FunctionalTestCase;
35 $this->importDataSet(__DIR__ .
'/../Fixtures/pages.xml');
37 $this->pageRepo->init(
false);
45 $rows = $this->pageRepo->getMenu(1,
'uid, title');
46 $this->assertArrayHasKey(2, $rows);
47 $this->assertArrayHasKey(3, $rows);
48 $this->assertArrayHasKey(4, $rows);
49 $this->assertCount(3, $rows);
57 $rows = $this->pageRepo->getMenu(2,
'uid, title');
58 $this->assertArrayHasKey(5, $rows);
59 $this->assertArrayHasKey(6, $rows);
60 $this->assertArrayHasKey(7, $rows);
61 $this->assertCount(3, $rows);
69 $rows = $this->pageRepo->getMenu(array(2, 3),
'uid, title');
70 $this->assertArrayHasKey(5, $rows);
71 $this->assertArrayHasKey(6, $rows);
72 $this->assertArrayHasKey(7, $rows);
73 $this->assertArrayHasKey(8, $rows);
74 $this->assertArrayHasKey(9, $rows);
75 $this->assertCount(5, $rows);
83 $this->pageRepo->sys_language_uid = 1;
85 $rows = $this->pageRepo->getMenu(array(2, 3),
'uid, title');
86 $this->assertEquals(
'Attrappe 1-2-5', $rows[5][
'title']);
87 $this->assertEquals(
'Attrappe 1-2-6', $rows[6][
'title']);
88 $this->assertEquals(
'Dummy 1-2-7', $rows[7][
'title']);
89 $this->assertEquals(
'Dummy 1-3-8', $rows[8][
'title']);
90 $this->assertEquals(
'Attrappe 1-3-9', $rows[9][
'title']);
91 $this->assertCount(5, $rows);
99 $row = $this->pageRepo->getPageOverlay(1, 1);
101 $this->assertEquals(
'Wurzel 1', $row[
'title']);
102 $this->assertEquals(
'901', $row[
'_PAGES_OVERLAY_UID']);
103 $this->assertEquals(1, $row[
'_PAGES_OVERLAY_LANGUAGE']);
111 $row = $this->pageRepo->getPageOverlay(4, 1);
112 $this->assertInternalType(
'array', $row);
113 $this->assertCount(0, $row);
121 $orig = $this->pageRepo->getPage(1);
122 $row = $this->pageRepo->getPageOverlay($orig, 1);
124 $this->assertEquals(1, $row[
'uid']);
125 $this->assertEquals(
'Wurzel 1', $row[
'title']);
126 $this->assertEquals(
'901', $row[
'_PAGES_OVERLAY_UID']);
127 $this->assertEquals(1, $row[
'_PAGES_OVERLAY_LANGUAGE']);
135 $orig = $this->pageRepo->getPage(4);
136 $row = $this->pageRepo->getPageOverlay($orig, 1);
137 $this->assertInternalType(
'array', $row);
138 $this->assertEquals(4, $row[
'uid']);
139 $this->assertEquals(
'Dummy 1-4', $row[
'title']);
147 $this->pageRepo->sys_language_uid = 1;
148 $rows = $this->pageRepo->getPagesOverlay(array(1));
149 $this->assertInternalType(
'array', $rows);
150 $this->assertCount(1, $rows);
151 $this->assertArrayHasKey(0, $rows);
155 $this->assertEquals(
'Wurzel 1', $row[
'title']);
156 $this->assertEquals(
'901', $row[
'_PAGES_OVERLAY_UID']);
157 $this->assertEquals(1, $row[
'_PAGES_OVERLAY_LANGUAGE']);
165 $this->pageRepo->sys_language_uid = 1;
166 $rows = $this->pageRepo->getPagesOverlay(array(1, 5));
167 $this->assertInternalType(
'array', $rows);
168 $this->assertCount(2, $rows);
169 $this->assertArrayHasKey(0, $rows);
170 $this->assertArrayHasKey(1, $rows);
174 $this->assertEquals(
'Wurzel 1', $row[
'title']);
175 $this->assertEquals(
'901', $row[
'_PAGES_OVERLAY_UID']);
176 $this->assertEquals(1, $row[
'_PAGES_OVERLAY_LANGUAGE']);
180 $this->assertEquals(
'Attrappe 1-2-5', $row[
'title']);
181 $this->assertEquals(
'904', $row[
'_PAGES_OVERLAY_UID']);
182 $this->assertEquals(1, $row[
'_PAGES_OVERLAY_LANGUAGE']);
190 $this->pageRepo->sys_language_uid = 1;
191 $rows = $this->pageRepo->getPagesOverlay(array(1, 4, 5, 8));
192 $this->assertInternalType(
'array', $rows);
193 $this->assertCount(2, $rows);
194 $this->assertArrayHasKey(0, $rows);
195 $this->assertArrayHasKey(2, $rows);
199 $this->assertEquals(
'Wurzel 1', $row[
'title']);
203 $this->assertEquals(
'Attrappe 1-2-5', $row[
'title']);
211 $origRow = $this->pageRepo->getPage(1);
213 $this->pageRepo->sys_language_uid = 1;
214 $rows = $this->pageRepo->getPagesOverlay(array($origRow));
215 $this->assertInternalType(
'array', $rows);
216 $this->assertCount(1, $rows);
217 $this->assertArrayHasKey(0, $rows);
221 $this->assertEquals(
'Wurzel 1', $row[
'title']);
222 $this->assertEquals(
'901', $row[
'_PAGES_OVERLAY_UID']);
223 $this->assertEquals(1, $row[
'_PAGES_OVERLAY_LANGUAGE']);
231 $orig1 = $this->pageRepo->getPage(1);
232 $orig2 = $this->pageRepo->getPage(5);
234 $this->pageRepo->sys_language_uid = 1;
235 $rows = $this->pageRepo->getPagesOverlay(array(1 => $orig1, 5 => $orig2));
236 $this->assertInternalType(
'array', $rows);
237 $this->assertCount(2, $rows);
238 $this->assertArrayHasKey(1, $rows);
239 $this->assertArrayHasKey(5, $rows);
243 $this->assertEquals(
'Wurzel 1', $row[
'title']);
244 $this->assertEquals(
'901', $row[
'_PAGES_OVERLAY_UID']);
245 $this->assertEquals(1, $row[
'_PAGES_OVERLAY_LANGUAGE']);
249 $this->assertEquals(
'Attrappe 1-2-5', $row[
'title']);
250 $this->assertEquals(
'904', $row[
'_PAGES_OVERLAY_UID']);
251 $this->assertEquals(1, $row[
'_PAGES_OVERLAY_LANGUAGE']);
259 $orig1 = $this->pageRepo->getPage(1);
260 $orig2 = $this->pageRepo->getPage(7);
261 $orig3 = $this->pageRepo->getPage(9);
263 $this->pageRepo->sys_language_uid = 1;
264 $rows = $this->pageRepo->getPagesOverlay(array($orig1, $orig2, $orig3));
265 $this->assertInternalType(
'array', $rows);
266 $this->assertCount(3, $rows);
267 $this->assertArrayHasKey(0, $rows);
268 $this->assertArrayHasKey(1, $rows);
269 $this->assertArrayHasKey(2, $rows);
273 $this->assertEquals(
'Wurzel 1', $row[
'title']);
277 $this->assertEquals(
'Dummy 1-2-7', $row[
'title']);
281 $this->assertEquals(
'Attrappe 1-3-9', $row[
'title']);
286 $this->assertInternalType(
'array', $row);
288 $this->assertArrayHasKey(
'_PAGES_OVERLAY', $row);
289 $this->assertArrayHasKey(
'_PAGES_OVERLAY_UID', $row);
290 $this->assertArrayHasKey(
'_PAGES_OVERLAY_LANGUAGE', $row);
292 $this->assertTrue($row[
'_PAGES_OVERLAY']);
297 $this->assertInternalType(
'array', $row);
299 $this->assertFalse(isset($row[
'_PAGES_OVERLAY']));
300 $this->assertFalse(isset($row[
'_PAGES_OVERLAY_UID']));
301 $this->assertFalse(isset($row[
'_PAGES_OVERLAY_LANGUAGE']));