Fixes unit tests
This commit is contained in:
parent
5d1480d6b9
commit
e85cbf80c5
|
|
@ -2,6 +2,17 @@
|
|||
|
||||
return array(
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Specifies the default CMS theme
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This parameter value can be overridden by the CMS back-end settings.
|
||||
|
|
||||
*/
|
||||
|
||||
'activeTheme' => 'test',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Plugins directory
|
||||
|
|
@ -66,14 +77,16 @@ return array(
|
|||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Specifies the default CMS theme
|
||||
| Determines if a friendly error page should be used.
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This parameter value can be overridden by the CMS back-end settings.
|
||||
| If this value is set to true, a friendly error page is used when an
|
||||
| exception is encountered. You must create a CMS page with route "/error"
|
||||
| to set the contents of this page. Otherwise the default error page is shown.
|
||||
|
|
||||
*/
|
||||
|
||||
'activeTheme' => 'test',
|
||||
'customErrorPage' => true,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
@ -88,7 +101,7 @@ return array(
|
|||
*/
|
||||
|
||||
'enableAssetCache' => false,
|
||||
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Disables Twig caching for unit tests
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ use Lang;
|
|||
use Cache;
|
||||
use Event;
|
||||
use Config;
|
||||
use DbDongle;
|
||||
use October\Rain\Support\Yaml;
|
||||
use System\Models\Parameters;
|
||||
use System\Classes\SystemException;
|
||||
|
|
@ -97,13 +98,15 @@ class Theme
|
|||
$paramKey = 'cms::theme.active';
|
||||
$activeTheme = Config::get('cms.activeTheme');
|
||||
|
||||
$dbResult = Parameters::findRecord($paramKey)
|
||||
->remember(1440, $paramKey)
|
||||
->pluck('value')
|
||||
;
|
||||
if (DbDongle::hasDatabase()) {
|
||||
$dbResult = Parameters::findRecord($paramKey)
|
||||
->remember(1440, $paramKey)
|
||||
->pluck('value')
|
||||
;
|
||||
|
||||
if ($dbResult !== null)
|
||||
$activeTheme = $dbResult;
|
||||
if ($dbResult !== null)
|
||||
$activeTheme = $dbResult;
|
||||
}
|
||||
|
||||
$apiResult = Event::fire('cms.activeTheme', [], true);
|
||||
if ($apiResult !== null)
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
|
||||
use Cms\Classes\Controller;
|
||||
use Cms\Classes\Theme;
|
||||
use Cms\Classes\Controller;
|
||||
|
||||
class ControllerTest extends TestCase
|
||||
{
|
||||
|
|
@ -10,7 +10,6 @@ class ControllerTest extends TestCase
|
|||
/*
|
||||
* Test the built-in 404 page
|
||||
*/
|
||||
|
||||
$theme = new Theme();
|
||||
$theme->load('apitest');
|
||||
$controller = new Controller($theme);
|
||||
|
|
@ -26,7 +25,6 @@ class ControllerTest extends TestCase
|
|||
/*
|
||||
* Test the theme 404 page
|
||||
*/
|
||||
|
||||
$theme = new Theme();
|
||||
$theme->load('test');
|
||||
$controller = new Controller($theme);
|
||||
|
|
|
|||
Loading…
Reference in New Issue