MINOR unit tests (from r83592)

This commit is contained in:
Tom Rix 2010-03-01 02:58:13 +00:00
parent 6d1b3901df
commit 3171075cd5
4 changed files with 11 additions and 2 deletions

View File

@ -13,7 +13,8 @@ class Subsite extends DataObject implements PermissionProvider {
*/
static $disable_subsite_filter = false;
static $default_sort = "\"Title\"";
static $write_hostmap = true;
static $default_sort = 'Title';
static $db = array(
'Title' => 'Varchar(255)',
@ -469,6 +470,8 @@ JS;
* @return void
*/
static function writeHostMap($file = null) {
if (!self::$write_hostmap) return;
if (!$file) $file = Director::baseFolder().'/subsites/host-map.php';
$hostmap = array();
@ -506,7 +509,8 @@ JS;
return array(
'SUBSITE_EDIT' => 'Edit Sub-site Details',
'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'
);
}

View File

@ -13,6 +13,7 @@ class SubsiteAdminTest extends SapphireTest {
* Test generation of the view
*/
function testBasicView() {
Subsite::$write_hostmap = false;
// Open the admin area logged in as admin
$response1 = Director::test('admin/subsites/', null, $this->adminLoggedInSession());

View File

@ -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
*/
function testSubsiteCreation() {
Subsite::$write_hostmap = false;
// Create the instance
$template = $this->objFromFixture('Subsite_Template', 'main');

View File

@ -5,6 +5,8 @@ class SubsitesVirtualPageTest extends SapphireTest {
// Attempt to bring main:linky to subsite2:linky
function testVirtualPageFromAnotherSubsite() {
Subsite::$write_hostmap = false;
$subsite = $this->objFromFixture('Subsite_Template', 'subsite2');
Subsite::changeSubsite($subsite->ID);