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

testGetBlogTemplates #3067

Conversation

nghiem-mb
Copy link
Contributor

No description provided.

$this->Blog->BcBaser->siteConfig['theme'] = $theme;
$result = $this->Blog->getBlogTemplates();
$this->assertEquals($result, $expected, 'ブログテンプレートを正しく取得できません');
$result = $this->Blog->getBlogTemplates(1);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nghiem-mb getBlogTempletes の第一引き数 $siteId の初期値は、1に変更してください。
baserCMS4から、baserCMS5になるにあたり、site_id が 0 というのはなくなったためです。

$this->assertEquals($result, $expected, 'ブログテンプレートを正しく取得できません');
$result = $this->Blog->getBlogTemplates(1);
$this->assertEquals($expected, $result);
$this->expectException('Cake\Datasource\Exception\RecordNotFoundException');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nghiem-mb ヘルパー呼び出しの際に、RecordNotFoundException が出てしまうのは良くないので、どこかで例外処理を書く必要があります。

}

public static function getBlogTemplatesDataProvider()
{
return [
['nada-icons', ['default' => 'default']]
['nada-icons', ['Blog' => 'Blog','default' => 'default']]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nghiem-mb 結果に、'Blog' => 'Blog' が入ってしまってはいけません。何が原因か調査してもらってもいいですか?

@ryuring ryuring added the Reviewed レビュー済 label Jan 29, 2024
@ryuring ryuring assigned nghiem-mb and unassigned ryuring Jan 29, 2024
@ryuring ryuring assigned HungDV2022 and unassigned nghiem-mb Feb 2, 2024
@HungDV2022
Copy link
Collaborator

#3113
こちらPRに修正しました。

@HungDV2022 HungDV2022 closed this Feb 14, 2024
@ryuring ryuring added this to the 5.0.9 milestone Feb 15, 2024
@ryuring ryuring modified the milestones: 5.0.9, 5.0.10 Feb 25, 2024
@momofff momofff modified the milestones: 5.0.10, close Apr 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Reviewed レビュー済
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants