Skip to content

Commit

Permalink
test_getCurrentAdminTheme (baserproject#2884)
Browse files Browse the repository at this point in the history
  • Loading branch information
nghiem-mb authored Dec 1, 2023
1 parent fe66b59 commit 436dc45
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions plugins/baser-core/src/Utility/BcUtil.php
Original file line number Diff line number Diff line change
Expand Up @@ -1244,6 +1244,7 @@ public static function getRootTheme()
* @return mixed|string
* @checked
* @noTodo
* @unitTest
*/
public static function getCurrentAdminTheme()
{
Expand Down
18 changes: 18 additions & 0 deletions plugins/baser-core/tests/TestCase/Utility/BcUtilTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;

Expand Down Expand Up @@ -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
*/
Expand Down

0 comments on commit 436dc45

Please sign in to comment.