Reset test state for modified config options

This commit is contained in:
Damian Mooyman 2017-09-28 17:24:32 +13:00
parent 53b2fcd1ea
commit f574f6d1b2
No known key found for this signature in database
GPG Key ID: 78B823A10DE27D1A
3 changed files with 34 additions and 9 deletions

View File

@ -9,6 +9,7 @@ SilverStripe\Core\Injector\Injector:
extensions: '%$SilverStripe\Dev\State\ExtensionTestState' extensions: '%$SilverStripe\Dev\State\ExtensionTestState'
flushable: '%$SilverStripe\Dev\State\FlushableTestState' flushable: '%$SilverStripe\Dev\State\FlushableTestState'
requirements: '%$SilverStripe\View\Dev\RequirementsTestState' requirements: '%$SilverStripe\View\Dev\RequirementsTestState'
ssviewer: '%$SilverStripe\View\Dev\SSViewerTestState'
--- ---
Name: kerneltest Name: kerneltest
Before: '*' Before: '*'

View File

@ -39,35 +39,29 @@ class ContentNegotiator
/** /**
* @config * @config
*
* @var string * @var string
*/ */
private static $content_type = ''; private static $content_type = '';
/** /**
* @config * @config
*
* @var string * @var string
*/ */
private static $encoding = 'utf-8'; private static $encoding = 'utf-8';
/** /**
* @config * @config
*
* @var bool * @var bool
*/ */
private static $enabled = false; private static $enabled = false;
/** /**
* @config
*
* @var bool * @var bool
*/ */
protected static $current_enabled = null; protected static $current_enabled = null;
/** /**
* @config * @config
*
* @var string * @var string
*/ */
private static $default_format = 'html'; private static $default_format = 'html';

View File

@ -0,0 +1,30 @@
<?php
namespace SilverStripe\View\Dev;
use SilverStripe\Control\ContentNegotiator;
use SilverStripe\Dev\SapphireTest;
use SilverStripe\Dev\State\TestState;
use SilverStripe\View\SSViewer;
class SSViewerTestState implements TestState
{
public function setUp(SapphireTest $test)
{
SSViewer::set_themes(null);
SSViewer::setRewriteHashLinksDefault(null);
ContentNegotiator::setEnabled(null);
}
public function tearDown(SapphireTest $test)
{
}
public function setUpOnce($class)
{
}
public function tearDownOnce($class)
{
}
}