diff --git a/plugins/bc-installer/src/Service/Admin/InstallationsAdminService.php b/plugins/bc-installer/src/Service/Admin/InstallationsAdminService.php index f99fd77b71..5745e49e2e 100644 --- a/plugins/bc-installer/src/Service/Admin/InstallationsAdminService.php +++ b/plugins/bc-installer/src/Service/Admin/InstallationsAdminService.php @@ -317,6 +317,7 @@ public function connectDb(ServerRequest $request): \Cake\Datasource\ConnectionIn * @return void * @checked * @noTodo + * @unitTest */ public function login(ServerRequest $request, Response $response): void { diff --git a/plugins/bc-installer/tests/TestCase/Service/Admin/InstallationsAdminServiceTest.php b/plugins/bc-installer/tests/TestCase/Service/Admin/InstallationsAdminServiceTest.php index 0b771023c0..bae0b3be87 100644 --- a/plugins/bc-installer/tests/TestCase/Service/Admin/InstallationsAdminServiceTest.php +++ b/plugins/bc-installer/tests/TestCase/Service/Admin/InstallationsAdminServiceTest.php @@ -22,6 +22,7 @@ use BcInstaller\Service\Admin\InstallationsAdminService; use BcInstaller\Service\Admin\InstallationsAdminServiceInterface; use Cake\Core\Configure; +use Cake\Http\Response; use Cake\Http\ServerRequest; use Cake\Http\Session; use Cake\ORM\Exception\PersistenceFailedException; @@ -538,7 +539,15 @@ public function test_connectDb() */ public function test_login() { - $this->markTestIncomplete('このテストは、まだ実装されていません。'); + //準備 + $this->loadFixtureScenario(InitAppScenario::class); + $request = $this->getRequest('/baser/admin/baser-core/users/index'); + $request->getSession()->write('Installation.id', 1); + $response = new Response(); + //テストを実行 + $this->Installations->login($request, $response); + //ログインできるか確認 + $this->assertEquals(1, $request->getSession()->read('AuthAdmin')->id); } /**