Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BcAdminHelper::convertAdminMenuGroups() ユニットテスト調整 #3817

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading