Skip to content

Commit

Permalink
Admin/ThemeFilesController::isDefaultTheme のユニットテスト (#2788)
Browse files Browse the repository at this point in the history
Co-authored-by: Đỗ Văn Hùng <[email protected]>
  • Loading branch information
HungDV2022 and dovanhung authored Oct 9, 2023
1 parent 67b7b53 commit 75afa7c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ public function __construct(
* 現在の画面のテーマがデフォルトテーマかどうか
*
* @return bool
* @checked
* @noTodo
* @unitTest
*/
protected function isDefaultTheme()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,24 @@ public function test__construct()
$this->assertEquals($_tempalteTypesExpected, $this->ThemeFilesController->_tempalteTypes);
}

/**
* test isDefaultTheme
*/
public function test_isDefaultTheme()
{
//テーマがデフォルトテーマの場合、
$request = $this->getRequest()->withParam('pass.0', 'BcFront');
$this->ThemeFilesController = new ThemeFilesController($this->loginAdmin($request));
$result = $this->execPrivateMethod($this->ThemeFilesController, 'isDefaultTheme', []);
$this->assertTrue($result);

//テーマがデフォルトテーマではないの場合、
$request = $this->getRequest()->withParam('pass.0', 'BcColumn');
$this->ThemeFilesController = new ThemeFilesController($this->loginAdmin($request));
$result = $this->execPrivateMethod($this->ThemeFilesController, 'isDefaultTheme', []);
$this->assertFalse($result);
}

/**
* test beforeRender
*/
Expand Down

0 comments on commit 75afa7c

Please sign in to comment.