Skip to content

Commit

Permalink
Merge pull request #3937 from thangnnmd/unitTest_BcAdminAppController…
Browse files Browse the repository at this point in the history
…_updateFirstAccess

BcAdminAppController::updateFirstAccess
  • Loading branch information
HungDV2022 authored Oct 24, 2024
2 parents 6a82803 + 3614039 commit be2e452
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ public function beforeRender(EventInterface $event): void
* @return void
* @checked
* @noTodo
* @unitTest
*/
private function __updateFirstAccess()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,4 +252,19 @@ public function testCheckPasswordModified()
$this->get('/baser/admin');
$this->assertResponseCode(200);
}

/**
* test updateFirstAccess
*/
public function testUpdateFirstAccess()
{
//before test
$siteConfigsService = $this->getService(SiteConfigsServiceInterface::class);
$siteConfigsService->setValue('first_access', true);
$this->assertEquals(1, $siteConfigsService->getValue('first_access'));

//after test
$this->execPrivateMethod($this->BcAdminApp, '__updateFirstAccess');
$this->assertEquals('', $siteConfigsService->getValue('first_access'));
}
}

0 comments on commit be2e452

Please sign in to comment.