diff --git a/plugins/bc-custom-content/src/Controller/Api/Admin/CustomContentsController.php b/plugins/bc-custom-content/src/Controller/Api/Admin/CustomContentsController.php index dc2f4f6144..60865659a3 100644 --- a/plugins/bc-custom-content/src/Controller/Api/Admin/CustomContentsController.php +++ b/plugins/bc-custom-content/src/Controller/Api/Admin/CustomContentsController.php @@ -32,6 +32,7 @@ class CustomContentsController extends BcAdminApiController * * @checked * @noTodo + * @unitTest */ public function index(CustomContentsServiceInterface $service) { diff --git a/plugins/bc-custom-content/tests/TestCase/Controller/Admin/Api/CustomContentsControllerTest.php b/plugins/bc-custom-content/tests/TestCase/Controller/Admin/Api/CustomContentsControllerTest.php index 78d8323cca..1ea73eb071 100644 --- a/plugins/bc-custom-content/tests/TestCase/Controller/Admin/Api/CustomContentsControllerTest.php +++ b/plugins/bc-custom-content/tests/TestCase/Controller/Admin/Api/CustomContentsControllerTest.php @@ -62,6 +62,22 @@ public function tearDown(): void parent::tearDown(); } + /** + * test index + */ + public function test_index() + { + //データを生成 + $this->loadFixtureScenario(CustomContentsScenario::class); + //APIを呼ぶ + $this->get('/baser/api/admin/bc-custom-content/custom_contents/index.json?token=' . $this->accessToken); + //ステータスを確認 + $this->assertResponseOk(); + //戻る値を確認 + $result = json_decode((string)$this->_response->getBody()); + $this->assertCount(2, $result->customContents); + } + /** * test add */