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

InstallationsService::buildPermissions #3907

Open
wants to merge 5 commits into
base: 5.1.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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/bc-installer/src/Service/InstallationsService.php
Original file line number Diff line number Diff line change
Expand Up @@ -593,6 +593,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,9 +11,11 @@

namespace BcInstaller\Test\TestCase\Service;

use BaserCore\Service\PermissionGroupsServiceInterface;
use BaserCore\Test\Factory\ContentFactory;
use BaserCore\Test\Factory\ContentFolderFactory;
use BaserCore\Test\Factory\SiteFactory;
use BaserCore\Test\Scenario\InitAppScenario;
use BaserCore\TestSuite\BcTestCase;
use BaserCore\Utility\BcContainerTrait;
use BaserCore\Utility\BcFile;
Expand All @@ -22,6 +24,7 @@
use BcInstaller\Service\InstallationsServiceInterface;
use Cake\Core\Configure;
use Cake\ORM\Exception\PersistenceFailedException;
use CakephpFixtureFactories\Scenario\ScenarioAwareTrait;

/**
* InstallationsServiceTest
Expand All @@ -34,6 +37,7 @@ class InstallationsServiceTest extends BcTestCase
* Trait
*/
use BcContainerTrait;
use ScenarioAwareTrait;

/**
* setup
Expand Down Expand Up @@ -397,4 +401,17 @@ public function testCreateDefaultFiles()
}
}

/**
* test buildPermissions
*/
public function test_buildPermissions()
{
$this->loadFixtureScenario(InitAppScenario::class);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@thangnnmd hình như thằng này ko cần chứ a,

$this->Installations->buildPermissions();

$permissionGroupsService = $this->getService(PermissionGroupsServiceInterface::class);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@thangnnmd thằng này đc khai báo rồi nên ko cần khai báo nữa.

$permissionGroups = $permissionGroupsService->getlist();
HungDV2022 marked this conversation as resolved.
Show resolved Hide resolved
$this->assertCount(28, $permissionGroups);
}

}
Loading