2011-03-18 16:17:04 +13:00
|
|
|
<?php
|
2016-07-22 11:32:32 +12:00
|
|
|
|
2017-08-09 14:53:38 +12:00
|
|
|
namespace SilverStripe\CMS\Tests\Controllers;
|
2017-08-09 13:25:12 +12:00
|
|
|
|
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;
|
|
|
|
|
2017-01-26 09:59:25 +13:00
|
|
|
class RootURLControllerTest extends SapphireTest
|
|
|
|
{
|
|
|
|
protected static $fixture_file = 'RootURLControllerTest.yml';
|
2016-03-09 09:50:55 +13:00
|
|
|
|
2017-01-26 09:59:25 +13:00
|
|
|
public function testGetHomepageLink()
|
|
|
|
{
|
|
|
|
$default = $this->objFromFixture('Page', 'home');
|
2016-03-09 09:50:55 +13:00
|
|
|
|
2017-07-17 17:19:00 +12:00
|
|
|
Config::modify()->set(SiteTree::class, 'nested_urls', false);
|
2017-01-26 09:59:25 +13:00
|
|
|
$this->assertEquals('home', RootURLController::get_homepage_link());
|
2017-07-17 17:19:00 +12:00
|
|
|
Config::modify()->set(SiteTree::class, 'nested_urls', true);
|
2017-01-26 09:59:25 +13:00
|
|
|
$this->assertEquals('home', RootURLController::get_homepage_link());
|
|
|
|
}
|
2012-04-12 19:23:20 +12:00
|
|
|
}
|