From d3a9a80c886d6726956102ca6e923858f9b3d372 Mon Sep 17 00:00:00 2001 From: HungDV2022 Date: Tue, 26 Nov 2024 18:40:44 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=A6=E3=83=8B=E3=83=83=E3=83=88=E3=83=86?= =?UTF-8?q?=E3=82=B9=E3=83=88=E8=AA=BF=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TestCase/Service/BlogPostsServiceTest.php | 16 ++-------------- .../TestCase/Service/BlogTagsServiceTest.php | 5 ++--- 2 files changed, 4 insertions(+), 17 deletions(-) diff --git a/plugins/bc-blog/tests/TestCase/Service/BlogPostsServiceTest.php b/plugins/bc-blog/tests/TestCase/Service/BlogPostsServiceTest.php index 6a159831e7..9ab0ed5939 100755 --- a/plugins/bc-blog/tests/TestCase/Service/BlogPostsServiceTest.php +++ b/plugins/bc-blog/tests/TestCase/Service/BlogPostsServiceTest.php @@ -893,19 +893,7 @@ public function testBatch() // データを生成 BlogContentFactory::make([ 'id' => 5, - 'description' => 'baserCMS inc. [デモ] の最新の情報をお届けします。', - 'template' => 'default', - 'list_count' => '10', - 'list_direction' => 'DESC', - 'feed_count' => '10', - 'tag_use' => '1', - 'comment_use' => '1', - 'comment_approve' => '0', - 'widget_area' => '2', 'eye_catch_size' => 'YTo0OntzOjExOiJ0aHVtYl93aWR0aCI7czozOiIzMDAiO3M6MTI6InRodW1iX2hlaWdodCI7czozOiIzMDAiO3M6MTg6Im1vYmlsZV90aHVtYl93aWR0aCI7czozOiIxMDAiO3M6MTk6Im1vYmlsZV90aHVtYl9oZWlnaHQiO3M6MzoiMTAwIjt9', - 'use_content' => '1', - 'created' => '2015-08-10 18:57:47', - 'modified' => NULL, ])->persist(); BlogPostFactory::make(['id' => '1', 'blog_content_id' => '5', 'title' => 'test blog post batch'])->persist(); BlogPostFactory::make(['id' => '2', 'blog_content_id' => '5', 'title' => 'test blog post batch'])->persist(); @@ -931,8 +919,8 @@ public function testBatch() // 存在しない id を指定された場合は例外が発生すること // サービスメソッドを呼ぶ - $this->expectException('Cake\Datasource\Exception\RecordNotFoundException'); - $result = $this->BlogPostsService->batch('delete', [1, 2, 3]); + $this->expectException(\TypeError::class); + $this->BlogPostsService->batch('update', [1, 2, 3]); } /** diff --git a/plugins/bc-blog/tests/TestCase/Service/BlogTagsServiceTest.php b/plugins/bc-blog/tests/TestCase/Service/BlogTagsServiceTest.php index 46f3bedcc3..56ce42ef81 100755 --- a/plugins/bc-blog/tests/TestCase/Service/BlogTagsServiceTest.php +++ b/plugins/bc-blog/tests/TestCase/Service/BlogTagsServiceTest.php @@ -124,7 +124,6 @@ public function testCreateIndexOrder() */ public function test_batch() { - $this->markTestIncomplete('このテストは未確認です'); // データを生成 $this->loadFixtureScenario(BlogTagsScenario::class); @@ -148,8 +147,8 @@ public function test_batch() // 存在しない id を指定された場合は例外が発生すること // サービスメソッドを呼ぶ - $this->expectException('Cake\Datasource\Exception\RecordNotFoundException'); - $this->BlogTagsService->batch('delete', [1, 2, 3]); + $this->expectException(\TypeError::class); + $this->BlogTagsService->batch('update', [1, 2, 3]); } /**