From f3ba023a4020d5f632aca300e285e426075abe5e Mon Sep 17 00:00:00 2001 From: HungDV2022 Date: Mon, 25 Nov 2024 12:12:31 +0900 Subject: [PATCH] =?UTF-8?q?BlogContentsController::redirectEditBlog()=20?= =?UTF-8?q?=E3=83=A6=E3=83=8B=E3=83=83=E3=83=88=E3=83=86=E3=82=B9=E3=83=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bc-blog/src/Controller/Admin/BlogContentsController.php | 1 + .../TestCase/Controller/Admin/BlogContentsControllerTest.php | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/bc-blog/src/Controller/Admin/BlogContentsController.php b/plugins/bc-blog/src/Controller/Admin/BlogContentsController.php index 667362d77a..f31e1b63b8 100755 --- a/plugins/bc-blog/src/Controller/Admin/BlogContentsController.php +++ b/plugins/bc-blog/src/Controller/Admin/BlogContentsController.php @@ -116,6 +116,7 @@ public function edit(BlogContentsAdminServiceInterface $service, int $id) * @return ResponseInterface * @checked * @noTodo + * @unitTest */ protected function redirectEditBlog(string $template): ResponseInterface { diff --git a/plugins/bc-blog/tests/TestCase/Controller/Admin/BlogContentsControllerTest.php b/plugins/bc-blog/tests/TestCase/Controller/Admin/BlogContentsControllerTest.php index 5d9a08e520..4995f40056 100755 --- a/plugins/bc-blog/tests/TestCase/Controller/Admin/BlogContentsControllerTest.php +++ b/plugins/bc-blog/tests/TestCase/Controller/Admin/BlogContentsControllerTest.php @@ -177,7 +177,10 @@ public function test_redirectEditLayout() */ public function test_redirectEditBlog() { - $this->markTestIncomplete('このテストは、まだ実装されていません。'); + $controller = new BlogContentsController($this->getRequest()); + $rs = $this->execPrivateMethod($controller, 'redirectEditBlog', ['BcColumn']); + $this->assertEquals('https://localhost/baser/admin/bc-theme-file/theme_files/edit/BcFront/BcBlog/etc/Blog/BcColumn/index.php', $rs->getHeader('Location')[0]); + $this->assertEquals(302, $rs->getStatusCode()); } }