mirror of
https://github.com/silverstripe/silverstripe-subsites
synced 2024-10-22 11:05:55 +02:00
5d3af16aaf
- 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)
37 lines
753 B
PHP
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);
|
|
}
|
|
}
|