silverstripe-subsites/tests/php/BaseSubsiteTest.php

37 lines
753 B
PHP
Raw Normal View History

<?php
2016-09-22 16:38:29 +02:00
namespace SilverStripe\Subsites\Tests;
2016-09-22 16:38:29 +02:00
use SilverStripe\Dev\SapphireTest;
2017-05-24 15:25:34 +02:00
use SilverStripe\Subsites\Model\Subsite;
2017-05-24 15:26:28 +02:00
class BaseSubsiteTest extends SapphireTest
{
2017-05-29 13:42:42 +02:00
public function setUp()
2017-05-24 15:26:28 +02:00
{
parent::setUp();
Subsite::$use_session_subsiteid = true;
Subsite::$force_subsite = null;
}
2017-05-24 15:26:28 +02:00
2017-05-29 13:42:42 +02: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);
2017-05-24 15:26:28 +02:00
return $obj;
}
2017-05-29 13:42:42 +02:00
/**
* Tests the initial state of disable_subsite_filter
*/
public function testDisableSubsiteFilter()
{$this->assertFalse(Subsite::$disable_subsite_filter);
}
}