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
PaymentRepository::findAllowedPayments() で、共通の支払方法が無い場合でも支払方法が取得できてしまう #1162
Comments
以下、再現テストケース。共通する支払方法は存在しないはずだが、 public function testFindAllowedPaymentWithExclusion()
{
$productTypes = array(1, 2);
$productTypes = array_unique($productTypes);
// ProductType 1 と 2 で, 共通する支払い方法を削除しておく
$PaymentOption = $this
->app['orm.em']
->getRepository('\Eccube\Entity\PaymentOption')
->findOneBy(
array(
'delivery_id' => 1,
'payment_id' => 3
)
);
$this->assertNotNull($PaymentOption);
$this->app['orm.em']->remove($PaymentOption);
$this->app['orm.em']->flush();
$deliveries = $this->app['eccube.repository.delivery']->getDeliveries($productTypes);
// 支払方法を取得
$payments = $this->app['eccube.repository.payment']->findAllowedPayments($deliveries);
$this->expected = 0;
$this->actual = count($payments);
$this->verify('商品種別共通の支払い方法は'.$this->expected.'種類です');
} |
#1158 で修正を PR しています。 |
👍 |
このテストケースを #1158 に組み込んでしまっていいですか? |
@shhirose はい、ありがとうございます。 nanasess@040fddf にコミットしてますので、 以下のように取り込んでいただけると嬉しいです。 curl -s https://github.com/nanasess/ec-cube/commit/040fddfd45fa432520f0d004c6617fc9b8dc88c7.patch | git am |
パッチを適応しようとしたら以下の様なエラーが出てしましました。 # curl -s https://github.com/nanasess/ec-cube/commit/040fddfd45fa432520f0d004c6617fc9b8dc88c7.patch | git am
Applying: issue #1162 のテストケースを追加
error: tests/Eccube/Tests/Repository/PaymentRepositoryTest.php: does not match index
Patch failed at 0001 issue #1162 のテストケースを追加
When you have resolved this problem run "git am --resolved".
If you would prefer to skip this patch, instead run "git am --skip".
To restore the original branch and stop patching run "git am --abort". |
|
@shhirose Pull Request しましたので、こちらを取り込んでいただけたらと思います |
issue EC-CUBE#1162 のテストケースを追加
ありがとうございます。 |
Fix #1158 |
#1156 の「また、購入確認画面で配送先の支払方法を変更すると、本来は選択できないはずの支払方法が選択できるようになってしまう。」の原因になっていると思われる。
The text was updated successfully, but these errors were encountered: