diff --git a/plugins/bc-uploader/src/Controller/Admin/UploaderConfigsController.php b/plugins/bc-uploader/src/Controller/Admin/UploaderConfigsController.php index 9def9f1fb6..b8d1f7b035 100644 --- a/plugins/bc-uploader/src/Controller/Admin/UploaderConfigsController.php +++ b/plugins/bc-uploader/src/Controller/Admin/UploaderConfigsController.php @@ -31,6 +31,7 @@ class UploaderConfigsController extends BcAdminAppController * @return void * @checked * @noTodo + * @unitTest */ public function index(UploaderConfigsServiceInterface $service) { diff --git a/plugins/bc-uploader/tests/TestCase/Controller/Admin/UploaderConfigsControllerTest.php b/plugins/bc-uploader/tests/TestCase/Controller/Admin/UploaderConfigsControllerTest.php new file mode 100644 index 0000000000..380a438e04 --- /dev/null +++ b/plugins/bc-uploader/tests/TestCase/Controller/Admin/UploaderConfigsControllerTest.php @@ -0,0 +1,45 @@ +loadFixtureScenario(InitAppScenario::class); + $this->UploaderConfigsController = new UploaderConfigsController($this->loginAdmin($this->getRequest())); + } + + public function tearDown(): void + { + parent::tearDown(); + } + + /** + * test index + */ + public function test_index() + { + $this->enableSecurityToken(); + $this->enableCsrfToken(); + + //正常系実行 + $this->get("/baser/admin/bc-uploader/uploader_configs/index"); + $this->assertResponseCode(200); + + $this->post("/baser/admin/bc-uploader/uploader_configs/index", ['name_add' => 'value_add']); + $this->assertResponseCode(302); + $this->assertFlashMessage('アップローダー設定を保存しました。'); + $this->assertRedirect("/baser/admin/bc-uploader/uploader_configs/index"); + } +} \ No newline at end of file