silverstripe-subsites/tests/php/BaseSubsiteTest.php
Tim Kung 5d3af16aaf - namespacing all classes
- moving all phpunit tests into tests/php
- moving all extensions from _config.php into config.yml and removing obsolete _config.php
- moving GridFieldSubsiteDetailForm_ItemRequest into own file

(cherry picked from commit ee02828)
2017-05-30 15:13:40 +02:00

37 lines
753 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.
*/
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);
}
}