-
Notifications
You must be signed in to change notification settings - Fork 655
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5558 from kurozumi/issue-5549
注文時に支払い方法が非表示に変更された場合エラーが発生するよう修正
- Loading branch information
Showing
5 changed files
with
72 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
tests/Eccube/Tests/Service/PurchaseFlow/Processor/PaymentValidatorTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of EC-CUBE | ||
* | ||
* Copyright(c) EC-CUBE CO.,LTD. All Rights Reserved. | ||
* | ||
* http://www.ec-cube.co.jp/ | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Eccube\Tests\Service\PurchaseFlow\Processor; | ||
|
||
use Eccube\Entity\Delivery; | ||
use Eccube\Service\PurchaseFlow\Processor\PaymentValidator; | ||
use Eccube\Service\PurchaseFlow\PurchaseContext; | ||
use Eccube\Tests\EccubeTestCase; | ||
|
||
class PaymentValidatorTest extends EccubeTestCase | ||
{ | ||
/** | ||
* @var PaymentValidator | ||
*/ | ||
private $validator; | ||
|
||
/** | ||
* @var $Order | ||
*/ | ||
private $Order; | ||
|
||
protected function setUp(): void | ||
{ | ||
parent::setUp(); | ||
|
||
$deliveryRepository = $this->entityManager->getRepository(Delivery::class); | ||
$this->validator = new PaymentValidator($deliveryRepository); | ||
|
||
$Customer = $this->createCustomer(); | ||
$this->Order = $this->createOrder($Customer); | ||
} | ||
|
||
public function testInstance() | ||
{ | ||
self::assertInstanceOf(PaymentValidator::class, $this->validator); | ||
} | ||
|
||
public function testValidatePaymentVisibleFalse() | ||
{ | ||
$this->Order->getPayment()->setVisible(false); | ||
|
||
$result = $this->validator->execute($this->Order, new PurchaseContext()); | ||
|
||
self::assertTrue($result->isError()); | ||
} | ||
} |