Skip to content

Commit

Permalink
InstallationsService::buildPermissions() のユニットテスト
Browse files Browse the repository at this point in the history
  • Loading branch information
dovanhung committed Oct 21, 2024
1 parent 7513928 commit fbad2f5
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 @@ -595,6 +595,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 @@ -410,6 +411,23 @@ public function testGetAllDefaultDataPatterns()
{
$this->markTestIncomplete('このテストは、まだ実装されていません。');
}

/**
* 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 fbad2f5

Please sign in to comment.