silverstripe-subsites/tests/BaseSubsiteTest.php

32 lines
695 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;
Subsite::$force_subsite = null;
2015-11-23 04:53:45 +01:00
}
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);
}
}