Skip to content

Commit

Permalink
ユニットテスト調整
Browse files Browse the repository at this point in the history
dovanhung committed Nov 26, 2024
1 parent 997c869 commit d3a9a80
Showing 2 changed files with 4 additions and 17 deletions.
16 changes: 2 additions & 14 deletions plugins/bc-blog/tests/TestCase/Service/BlogPostsServiceTest.php
Original file line number Diff line number Diff line change
@@ -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]);
}

/**
Original file line number Diff line number Diff line change
@@ -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]);
}

/**

0 comments on commit d3a9a80

Please sign in to comment.