silverstripe-cms/tests/controller/RootURLControllerTest.php

25 lines
699 B
PHP
Raw Permalink Normal View History

<?php
2016-07-22 11:32:32 +12:00
use SilverStripe\CMS\Model\SiteTree;
use SilverStripe\CMS\Controllers\RootURLController;
use SilverStripe\Core\Config\Config;
use SilverStripe\Dev\SapphireTest;
/**
* @package cms
* @subpackage tests
*/
class RootURLControllerTest extends SapphireTest {
protected static $fixture_file = 'RootURLControllerTest.yml';
2016-03-09 09:50:55 +13:00
public function testGetHomepageLink() {
$default = $this->objFromFixture('Page', 'home');
2016-03-09 09:50:55 +13:00
SiteTree::config()->nested_urls = false;
$this->assertEquals('home', RootURLController::get_homepage_link());
2016-07-22 11:32:32 +12:00
Config::inst()->update('SilverStripe\\CMS\\Model\\SiteTree', 'nested_urls', true);
$this->assertEquals('home', RootURLController::get_homepage_link());
}
2016-03-09 09:50:55 +13:00
}