diff --git a/plugins/baser-core/src/Utility/BcUtil.php b/plugins/baser-core/src/Utility/BcUtil.php index d82ab313b4..3ef0e8dc6c 100644 --- a/plugins/baser-core/src/Utility/BcUtil.php +++ b/plugins/baser-core/src/Utility/BcUtil.php @@ -1244,6 +1244,7 @@ public static function getRootTheme() * @return mixed|string * @checked * @noTodo + * @unitTest */ public static function getCurrentAdminTheme() { diff --git a/plugins/baser-core/tests/TestCase/Utility/BcUtilTest.php b/plugins/baser-core/tests/TestCase/Utility/BcUtilTest.php index 274e97aa36..a4eda7f55b 100644 --- a/plugins/baser-core/tests/TestCase/Utility/BcUtilTest.php +++ b/plugins/baser-core/tests/TestCase/Utility/BcUtilTest.php @@ -12,10 +12,12 @@ namespace BaserCore\Test\TestCase\Utility; use BaserCore\Event\BcEventListener; +use BaserCore\Model\Entity\SiteConfig; use BaserCore\Test\Factory\SiteConfigFactory; use BaserCore\Test\Factory\UserFactory; use BaserCore\Test\Factory\UserGroupFactory; use BaserCore\Test\Factory\UsersUserGroupFactory; +use BaserCore\View\BcAdminAppView; use Cake\Core\App; use Cake\Cache\Cache; use Cake\Core\Plugin; @@ -27,6 +29,7 @@ use BaserCore\TestSuite\BcTestCase; use Cake\Http\ServerRequestFactory; use Cake\Http\Session; +use Cake\ORM\TableRegistry; use Cake\Routing\Router; use Cake\Utility\Inflector; @@ -844,6 +847,21 @@ public function test_getViewPath() } + /** + * test getCurrentAdminTheme + */ + public function test_getCurrentAdminTheme() + { + //site_configs テーブルの admin_theme を変更した場合 + $SiteConfig = TableRegistry::getTableLocator()->get('BaserCore.SiteConfigs'); + $siteConfig = $SiteConfig->get(16); + $siteConfig->value = 'test theme'; + $SiteConfig->save($siteConfig); + $result = BcUtil::getCurrentAdminTheme(); + $this->assertEquals('test theme',$result); + } + + /** * testGetPluginPath */