Reset test state for modified config options
This commit is contained in:
parent
53b2fcd1ea
commit
f574f6d1b2
|
@ -9,6 +9,7 @@ SilverStripe\Core\Injector\Injector:
|
|||
extensions: '%$SilverStripe\Dev\State\ExtensionTestState'
|
||||
flushable: '%$SilverStripe\Dev\State\FlushableTestState'
|
||||
requirements: '%$SilverStripe\View\Dev\RequirementsTestState'
|
||||
ssviewer: '%$SilverStripe\View\Dev\SSViewerTestState'
|
||||
---
|
||||
Name: kerneltest
|
||||
Before: '*'
|
||||
|
|
|
@ -39,35 +39,29 @@ class ContentNegotiator
|
|||
|
||||
/**
|
||||
* @config
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private static $content_type = '';
|
||||
|
||||
/**
|
||||
* @config
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private static $encoding = 'utf-8';
|
||||
|
||||
/**
|
||||
* @config
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
private static $enabled = false;
|
||||
|
||||
|
||||
/**
|
||||
* @config
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
protected static $current_enabled = null;
|
||||
|
||||
/**
|
||||
* @config
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private static $default_format = 'html';
|
||||
|
@ -97,7 +91,7 @@ class ContentNegotiator
|
|||
return (substr($response->getBody(), 0, 5) == '<' . '?xml');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the current enabled status, if it is not set this will fallback to config
|
||||
*
|
||||
|
@ -110,7 +104,7 @@ class ContentNegotiator
|
|||
}
|
||||
return Config::inst()->get(static::class, 'enabled');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the current enabled status
|
||||
*
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue