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'
|
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: '*'
|
||||||
|
|
|
@ -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';
|
||||||
|
@ -97,7 +91,7 @@ class ContentNegotiator
|
||||||
return (substr($response->getBody(), 0, 5) == '<' . '?xml');
|
return (substr($response->getBody(), 0, 5) == '<' . '?xml');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the current enabled status, if it is not set this will fallback to config
|
* 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');
|
return Config::inst()->get(static::class, 'enabled');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the current enabled status
|
* 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