silverstripe-subsites/tests/php/BaseSubsiteTest.php
Werner M. Krauß a4a1ab6a78 formatting code
2017-06-01 15:57:53 +02:00

42 lines
917 B
PHP

<?php
namespace SilverStripe\Subsites\Tests;
use SilverStripe\Dev\SapphireTest;
use SilverStripe\Subsites\Model\Subsite;
class BaseSubsiteTest extends SapphireTest
{
public function setUp()
{
parent::setUp();
Subsite::$use_session_subsiteid = true;
Subsite::$force_subsite = null;
}
/**
* Avoid subsites filtering on fixture fetching.
* @param string $class
* @param string $id
* @return \SilverStripe\ORM\DataObject
*/
public 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
*/
public function testDisableSubsiteFilter()
{
$this->assertFalse(Subsite::$disable_subsite_filter);
}
}