Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ユニットテスト調整 BlogCommentsService::getBlogContent #3086

Merged
merged 5 commits into from
Feb 19, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions plugins/bc-blog/src/Service/BlogCommentsService.php
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ public function add(int $blogContentId, int $blogPostId, array $postData)
* @return EntityInterface
* @checked
* @noTodo
* @unitTest
*/
public function getBlogContent($blogContentId)
{
Expand Down
21 changes: 21 additions & 0 deletions plugins/bc-blog/tests/TestCase/Service/BlogCommentsServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -217,4 +217,25 @@ public function testBatch()
$this->assertEquals($count - 3, $this->BlogCommentsService->getIndex(['blog_post_id' => 1])->count());
}

/**
* getBlogContent
* @return void
*/
public function testGetBlogContent(){
HungDV2022 marked this conversation as resolved.
Show resolved Hide resolved
$this->loadFixtureScenario(
BlogContentScenario::class,
1, // id
1, // siteId
null, // parentId
'news1', // name
'/news/' // url
);
BlogPostFactory::make(['id' => 1, 'blog_content_id' => 1])->persist();
$blogContent = $this->BlogCommentsService->getBlogContent(1);
$this->assertEquals('ディスクリプション', $blogContent['description']);
$this->assertEquals('homePage', $blogContent['template']);
HungDV2022 marked this conversation as resolved.
Show resolved Hide resolved
}



}
Loading