silverstripe-subsites/tests/BaseSubsiteTest.php

33 lines
632 B
PHP
Raw Normal View History

<?php
2016-09-22 16:38:29 +02:00
use SilverStripe\Dev\SapphireTest;
2017-05-24 15:25:34 +02:00
use SilverStripe\Subsites\Model\Subsite;
class BaseSubsiteTest extends SapphireTest {
function setUp() {
parent::setUp();
Subsite::$use_session_subsiteid = true;
}
/**
* Avoid subsites filtering on fixture fetching.
*/
function objFromFixture($class, $id) {
Subsite::disable_subsite_filter(true);
$obj = parent::objFromFixture($class, $id);
Subsite::disable_subsite_filter(false);
return $obj;
}
/**
* Tests the initial state of disable_subsite_filter
*/
function testDisableSubsiteFilter() {
$this->assertFalse(Subsite::$disable_subsite_filter);
}
}