@@ 351-360 (lines=10) @@ | ||
348 | $this->assertEquals('important-page', $mainSubsiteImportantPage->URLSegment); |
|
349 | } |
|
350 | ||
351 | public function testCopySubsiteWithChildren() |
|
352 | { |
|
353 | $page = $this->objFromFixture('Page', 'about'); |
|
354 | $newSubsite = $this->objFromFixture(Subsite::class, 'subsite1'); |
|
355 | ||
356 | $moved = $page->duplicateToSubsite($newSubsite->ID, true); |
|
357 | $this->assertEquals($moved->SubsiteID, $newSubsite->ID, 'Ensure returned records are on new subsite'); |
|
358 | $this->assertEquals( |
|
359 | $moved->AllChildren()->count(), |
|
360 | $page->AllChildren()->count(), |
|
361 | 'All pages are copied across' |
|
362 | ); |
|
363 | } |
|
@@ 365-373 (lines=9) @@ | ||
362 | ); |
|
363 | } |
|
364 | ||
365 | public function testCopySubsiteWithoutChildren() |
|
366 | { |
|
367 | $page = $this->objFromFixture('Page', 'about'); |
|
368 | $newSubsite = $this->objFromFixture(Subsite::class, 'subsite2'); |
|
369 | ||
370 | $moved = $page->duplicateToSubsite($newSubsite->ID, false); |
|
371 | $this->assertEquals($moved->SubsiteID, $newSubsite->ID, 'Ensure returned records are on new subsite'); |
|
372 | $this->assertEquals($moved->AllChildren()->count(), 0, 'All pages are copied across'); |
|
373 | } |
|
374 | ||
375 | public function testIfSubsiteThemeIsSetToThemeList() |
|
376 | { |