Skip to content

Commit

Permalink
BcAdminHelper::convertAdminMenuGroups() ユニットテスト調整
Browse files Browse the repository at this point in the history
  • Loading branch information
dovanhung committed Sep 17, 2024
1 parent f4cfa00 commit 9477ed0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
1 change: 1 addition & 0 deletions plugins/baser-core/src/View/Helper/BcAdminHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ private function getAdminMenuGroups()
* @return array
* @checked
* @noTodo
* @unitTest
*/
private function convertAdminMenuGroups($adminMenuGroups)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,9 +214,20 @@ public function testGetAdminMenuGroups(): void
*/
public function testConvertAdminMenuGroups(): void
{
// $adminMenuGroups = $this->BcAdmin->getAdminMenuGroups();
// $covertedAdminMenuGroups = $this->BcAdmin->convertAdminMenuGroups($adminMenuGroups);
$this->markTestIncomplete('Not implemented yet.');
//データー生成
$this->loadFixtureScenario(InitAppScenario::class);
$request = $this->loginAdmin($this->getRequest('/baser/admin'));
$this->BcAdmin->getView()->setRequest($request);

//対象メソッドを実行
$adminMenuGroups = $this->execPrivateMethod($this->BcAdmin, 'getAdminMenuGroups');
$covertedAdminMenuGroups = $this->execPrivateMethod($this->BcAdmin, 'convertAdminMenuGroups', [$adminMenuGroups]);

//戻り値を確認
$this->assertEquals('ダッシュボード', $covertedAdminMenuGroups[0]['title']);
$this->assertEquals('/baser/admin', $covertedAdminMenuGroups[0]['url']);
$this->assertEquals('dashboard', $covertedAdminMenuGroups[0]['type']);
$this->assertEquals('bca-icon--file', $covertedAdminMenuGroups[0]['icon']);
}

/**
Expand Down

0 comments on commit 9477ed0

Please sign in to comment.