mirror of
https://github.com/silverstripe/silverstripe-subsites
synced 2024-10-22 11:05:55 +02:00
37 lines
720 B
PHP
37 lines
720 B
PHP
<?php
|
|
|
|
use SilverStripe\Dev\SapphireTest;
|
|
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);
|
|
}
|
|
|
|
}
|