Skip to content

Commit

Permalink
Merge pull request #1 from chihiro-adachi/patch-1
Browse files Browse the repository at this point in the history
テストを追加
  • Loading branch information
sw-satoshi-nakano authored Apr 8, 2019
2 parents 04d6bbe + 58540e0 commit 09981b7
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions tests/Eccube/Tests/Web/Mypage/DeliveryControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,4 +176,40 @@ public function testDeleteWithFailure()
$this->actual = $this->client->getResponse()->getStatusCode();
$this->verify();
}

/**
* @see https://github.com/EC-CUBE/ec-cube/pull/4127
*/
public function testDeliveryCountOver()
{
$this->logInTo($this->Customer);

$crawler = $this->client->request(
'GET',
$this->generateUrl('mypage_delivery')
);

// お届け先上限のエラーがないことを確認.
$this->assertCount(0, $crawler->filter('span.ec-errorMessage'));

// お届け先上限まで登録
$max = $this->container->getParameter('eccube_deliv_addr_max');
for ($i = 0; $i < $max; $i++) {
$this->createCustomerAddress($this->Customer);
}

$crawler = $this->client->request(
'GET',
$this->generateUrl('mypage_delivery')
);

// お届け先上限のエラーメッセージが表示されることを確認
$errorMessage = $crawler->filter('span.ec-errorMessage');

$this->assertCount(1, $errorMessage);
$this->assertSame(
sprintf('お届け先登録の上限の%s件に達しています。お届け先を入力したい場合は、削除か変更を行ってください。', $max),
$errorMessage->text()
);
}
}

0 comments on commit 09981b7

Please sign in to comment.