mirror of
https://github.com/silverstripe/silverstripe-subsites
synced 2024-10-22 11:05:55 +02:00
MINOR unit tests (from r83592)
This commit is contained in:
parent
6d1b3901df
commit
3171075cd5
@ -13,7 +13,8 @@ class Subsite extends DataObject implements PermissionProvider {
|
|||||||
*/
|
*/
|
||||||
static $disable_subsite_filter = false;
|
static $disable_subsite_filter = false;
|
||||||
|
|
||||||
static $default_sort = "\"Title\"";
|
static $write_hostmap = true;
|
||||||
|
static $default_sort = 'Title';
|
||||||
|
|
||||||
static $db = array(
|
static $db = array(
|
||||||
'Title' => 'Varchar(255)',
|
'Title' => 'Varchar(255)',
|
||||||
@ -469,6 +470,8 @@ JS;
|
|||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
static function writeHostMap($file = null) {
|
static function writeHostMap($file = null) {
|
||||||
|
if (!self::$write_hostmap) return;
|
||||||
|
|
||||||
if (!$file) $file = Director::baseFolder().'/subsites/host-map.php';
|
if (!$file) $file = Director::baseFolder().'/subsites/host-map.php';
|
||||||
$hostmap = array();
|
$hostmap = array();
|
||||||
|
|
||||||
@ -506,7 +509,8 @@ JS;
|
|||||||
return array(
|
return array(
|
||||||
'SUBSITE_EDIT' => 'Edit Sub-site Details',
|
'SUBSITE_EDIT' => 'Edit Sub-site Details',
|
||||||
'SUBSITE_ACCESS_ALL' => 'Access all subsites',
|
'SUBSITE_ACCESS_ALL' => 'Access all subsites',
|
||||||
'SUBSITE_ASSETS_EDIT' => 'Edit Sub-site Assets Admin'
|
'SUBSITE_ASSETS_EDIT' => 'Edit Sub-site Assets Admin',
|
||||||
|
'SUBSITE_ASSETS_CREATE_SUBSITE' => 'Create/edit sub-site specific asset folders'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,6 +13,7 @@ class SubsiteAdminTest extends SapphireTest {
|
|||||||
* Test generation of the view
|
* Test generation of the view
|
||||||
*/
|
*/
|
||||||
function testBasicView() {
|
function testBasicView() {
|
||||||
|
Subsite::$write_hostmap = false;
|
||||||
// Open the admin area logged in as admin
|
// Open the admin area logged in as admin
|
||||||
$response1 = Director::test('admin/subsites/', null, $this->adminLoggedInSession());
|
$response1 = Director::test('admin/subsites/', null, $this->adminLoggedInSession());
|
||||||
|
|
||||||
|
@ -37,6 +37,8 @@ class SubsiteTest extends SapphireTest {
|
|||||||
* Create a new subsite from the template and verify that all the template's pages are copied
|
* Create a new subsite from the template and verify that all the template's pages are copied
|
||||||
*/
|
*/
|
||||||
function testSubsiteCreation() {
|
function testSubsiteCreation() {
|
||||||
|
Subsite::$write_hostmap = false;
|
||||||
|
|
||||||
// Create the instance
|
// Create the instance
|
||||||
$template = $this->objFromFixture('Subsite_Template', 'main');
|
$template = $this->objFromFixture('Subsite_Template', 'main');
|
||||||
|
|
||||||
|
@ -5,6 +5,8 @@ class SubsitesVirtualPageTest extends SapphireTest {
|
|||||||
|
|
||||||
// Attempt to bring main:linky to subsite2:linky
|
// Attempt to bring main:linky to subsite2:linky
|
||||||
function testVirtualPageFromAnotherSubsite() {
|
function testVirtualPageFromAnotherSubsite() {
|
||||||
|
Subsite::$write_hostmap = false;
|
||||||
|
|
||||||
$subsite = $this->objFromFixture('Subsite_Template', 'subsite2');
|
$subsite = $this->objFromFixture('Subsite_Template', 'subsite2');
|
||||||
|
|
||||||
Subsite::changeSubsite($subsite->ID);
|
Subsite::changeSubsite($subsite->ID);
|
||||||
|
Loading…
Reference in New Issue
Block a user