silverstripe-subsites/tests/BaseSubsiteTest.php

31 lines
661 B
PHP
Raw Normal View History

<?php
2015-11-23 04:53:45 +01:00
class BaseSubsiteTest extends SapphireTest
{
public function setUp()
{
parent::setUp();
2015-11-23 04:53:45 +01:00
Subsite::$use_session_subsiteid = true;
}
2015-11-23 04:53:45 +01:00
/**
* Avoid subsites filtering on fixture fetching.
*/
public function objFromFixture($class, $id)
{
Subsite::disable_subsite_filter(true);
$obj = parent::objFromFixture($class, $id);
Subsite::disable_subsite_filter(false);
2015-11-23 04:53:45 +01:00
return $obj;
}
2015-11-23 04:53:45 +01:00
/**
* Tests the initial state of disable_subsite_filter
*/
public function testDisableSubsiteFilter()
{
$this->assertFalse(Subsite::$disable_subsite_filter);
}
}