-
Notifications
You must be signed in to change notification settings - Fork 652
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 #5974 from takeuji/calc_order_tax
受注テーブルのtaxに税率ごとの消費税額の合算を設定する
- Loading branch information
Showing
6 changed files
with
126 additions
and
30 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
52 changes: 52 additions & 0 deletions
52
tests/Eccube/Tests/Service/PurchaseFlow/Processor/PaymentTotalNegativeValidatorTest.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,52 @@ | ||
<?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\Cart; | ||
use Eccube\Service\PurchaseFlow\Processor\PaymentTotalNegativeValidator; | ||
use Eccube\Service\PurchaseFlow\PurchaseContext; | ||
use Eccube\Tests\EccubeTestCase; | ||
|
||
class PaymentTotalNegativeValidatorTest extends EccubeTestCase | ||
{ | ||
public function testPositiveValidate() | ||
{ | ||
$validator = $this->newValidator(); | ||
|
||
$cart = new Cart(); | ||
$cart->setTotal(100); | ||
|
||
$result = $validator->execute($cart, new PurchaseContext()); | ||
self::assertTrue($result->isSuccess()); | ||
} | ||
|
||
public function testNegativeValidate() | ||
{ | ||
$validator = $this->newValidator(); | ||
|
||
$cart = new Cart(); | ||
$cart->setTotal(-100); | ||
|
||
$result = $validator->execute($cart, new PurchaseContext()); | ||
self::assertTrue($result->isError()); | ||
} | ||
|
||
/** | ||
* @return PaymentTotalNegativeValidator | ||
*/ | ||
private function newValidator() | ||
{ | ||
return static::getContainer()->get(PaymentTotalNegativeValidator::class); | ||
} | ||
} |
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