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