| Conditions | 1 |
| Paths | 1 |
| Total Lines | 25 |
| Code Lines | 19 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 17 | public function testIfSubsiteThemeIsSetToThemeList() |
||
| 18 | { |
||
| 19 | $this->markTestSkipped('doesn\'t work somehow - refactor when domain lookup is working'); |
||
| 20 | $defaultThemes = ['default']; |
||
| 21 | SSViewer::set_themes($defaultThemes); |
||
| 22 | |||
| 23 | $subsitePage = $this->objFromFixture(Page::class, 'contact'); |
||
| 24 | $this->get($subsitePage->AbsoluteLink()); |
||
| 25 | $this->assertEquals($subsitePage->SubsiteID, SubsiteState::singleton()->getSubsiteId(), 'Subsite should be changed'); |
||
| 26 | $this->assertEquals( |
||
| 27 | SSViewer::get_themes(), |
||
| 28 | $defaultThemes, |
||
| 29 | 'Themes should not be modified when Subsite has no theme defined' |
||
| 30 | ); |
||
| 31 | |||
| 32 | $pageWithTheme = $this->objFromFixture(Page::class, 'subsite1_contactus'); |
||
| 33 | $this->get($pageWithTheme->AbsoluteLink()); |
||
| 34 | $subsiteTheme = $pageWithTheme->Subsite()->Theme; |
||
| 35 | $this->assertEquals($pageWithTheme->SubsiteID, SubsiteState::singleton()->getSubsiteId(), 'Subsite should be changed'); |
||
| 36 | $this->assertEquals( |
||
| 37 | SSViewer::get_themes(), |
||
| 38 | array_merge([$subsiteTheme], $defaultThemes), |
||
| 39 | 'Themes should be modified when Subsite has theme defined' |
||
| 40 | ); |
||
| 41 | } |
||
| 42 | } |
||
| 43 |