Skip to content

Commit

Permalink
Merge pull request #3934 from HungDV2022/unitest_InstallationsService…
Browse files Browse the repository at this point in the history
…_buildPermissions

InstallationsService::buildPermissions() のユニットテスト
  • Loading branch information
HungDV2022 authored Oct 24, 2024
2 parents 25f8bfa + fbad2f5 commit c2db642
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions plugins/bc-installer/src/Service/InstallationsService.php
Original file line number Diff line number Diff line change
Expand Up @@ -599,6 +599,7 @@ public function sendCompleteMail(array $postData)
* アクセスルールを構築する
* @checked
* @noTodo
* @unitTest
*/
public function buildPermissions()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

namespace BcInstaller\Test\TestCase\Service;

use BaserCore\Service\PermissionGroupsServiceInterface;
use BaserCore\Test\Factory\ContentFactory;
use BaserCore\Test\Factory\ContentFolderFactory;
use BaserCore\Test\Factory\SiteFactory;
Expand Down Expand Up @@ -466,6 +467,23 @@ public function testGetAllDefaultDataPatterns()
$this->assertEquals('サンプルテーマ ( default )', $rs['BcThemeSample.default']);
$this->assertEquals('サンプルテーマ ( empty )', $rs['BcThemeSample.empty']);
}

/**
* test buildPermissions
*/
public function testBuildPermissions()
{
//準備
$PermissionGroupsService = $this->getService(PermissionGroupsServiceInterface::class);

//テスト前にアクセスルールをチェック
$this->assertCount(0, $PermissionGroupsService->getList());
//テストを実行
$this->Installations->buildPermissions();
//テスト後にアクセスルールをチェック
$this->assertCount(4, $PermissionGroupsService->getList());
}

/**
* アップロード用初期フォルダを作成する
* test createDefaultFiles
Expand Down

0 comments on commit c2db642

Please sign in to comment.