2011-03-18 16:17:04 +13:00
|
|
|
<?php
|
2016-07-22 11:32:32 +12:00
|
|
|
|
|
|
|
use SilverStripe\CMS\Model\SiteTree;
|
|
|
|
use SilverStripe\CMS\Controllers\RootURLController;
|
2016-08-23 14:36:06 +12:00
|
|
|
use SilverStripe\Core\Config\Config;
|
|
|
|
use SilverStripe\Dev\SapphireTest;
|
|
|
|
|
2011-03-18 16:17:04 +13:00
|
|
|
/**
|
2011-03-22 22:47:26 +13:00
|
|
|
* @package cms
|
2011-03-18 16:17:04 +13:00
|
|
|
* @subpackage tests
|
|
|
|
*/
|
|
|
|
class RootURLControllerTest extends SapphireTest {
|
2013-03-18 11:47:15 +01:00
|
|
|
protected static $fixture_file = 'RootURLControllerTest.yml';
|
2016-03-09 09:50:55 +13:00
|
|
|
|
2011-03-18 16:17:04 +13:00
|
|
|
public function testGetHomepageLink() {
|
|
|
|
$default = $this->objFromFixture('Page', 'home');
|
2016-03-09 09:50:55 +13:00
|
|
|
|
2013-03-18 11:47:15 +01:00
|
|
|
SiteTree::config()->nested_urls = false;
|
2011-03-18 16:17:04 +13:00
|
|
|
$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);
|
2011-03-18 16:17:04 +13:00
|
|
|
$this->assertEquals('home', RootURLController::get_homepage_link());
|
|
|
|
}
|
2016-03-09 09:50:55 +13:00
|
|
|
|
2012-04-12 19:23:20 +12:00
|
|
|
}
|