mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
26 lines
740 B
PHP
26 lines
740 B
PHP
<?php
|
|
|
|
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';
|
|
|
|
public function testGetHomepageLink()
|
|
{
|
|
$default = $this->objFromFixture('Page', 'home');
|
|
|
|
Config::modify()->set(SiteTree::class, 'nested_urls', false);
|
|
$this->assertEquals('home', RootURLController::get_homepage_link());
|
|
Config::modify()->set(SiteTree::class, 'nested_urls', true);
|
|
$this->assertEquals('home', RootURLController::get_homepage_link());
|
|
}
|
|
}
|