Skip to content

Commit

Permalink
メール設定のテストを追加
Browse files Browse the repository at this point in the history
  • Loading branch information
chihiro-adachi committed Apr 16, 2024
1 parent aa6f4f8 commit d0e966e
Show file tree
Hide file tree
Showing 2 changed files with 264 additions and 89 deletions.
43 changes: 43 additions & 0 deletions tests/Eccube/Tests/Web/Admin/Order/MailControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,4 +123,47 @@ public function testComplete()
$this->actual = $Message->getSubject();
$this->verify();
}

/**
* メールテンプレートを選択する
*
* @return void
*/
public function testSelectMailTemplate()
{
$form = $this->createFormData();
// 注文完了メール
$form['template'] = 1;
$crawler = $this->client->request(
'POST',
$this->generateUrl('admin_order_mail', ['id' => $this->Order->getId()]),
[
'admin_order_mail' => $form,
'mode' => 'change',
]
);

$this->assertTrue($this->client->getResponse()->isOk());

$this->actual = $crawler->filter('input[name="admin_order_mail[mail_subject]"]')->attr('value');
$this->expected = 'ご注文ありがとうございます';
$this->verify();

// 会員仮登録完了メール
$form['template'] = 2;
$crawler = $this->client->request(
'POST',
$this->generateUrl('admin_order_mail', ['id' => $this->Order->getId()]),
[
'admin_order_mail' => $form,
'mode' => 'change',
]
);

$this->assertTrue($this->client->getResponse()->isOk());

$this->actual = $crawler->filter('input[name="admin_order_mail[mail_subject]"]')->attr('value');
$this->expected = '会員登録のご確認';
$this->verify();
}
}
Loading

0 comments on commit d0e966e

Please sign in to comment.