-
-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bug #13769 [Core][Shipping] Fix estimated shipping costs (coldic3, lc…
…hrusciel) This PR was merged into the 1.10 branch. Discussion ---------- | Q | A | --------------- | ----- | Branch? | 1.10 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Related tickets | fixes Sylius/Sylius#12554, Sylius/Sylius#13123, related to Sylius/Sylius#13126 | License | MIT Commits ------- 2863527a9dc012b92dceb8fe6f067db59c5f4879 [Core][Shipping][Behat] Add estimated shipping cost scenarios caa04093d1ec25bce846395f0472dc5cbd1dcfab [Core][Shipping] Change order processing priorities d6dbbcdd785236c85a00416ecca5f19b9b68066a [Core][Shipping] Update UPGRADE-1.10.md 9d9f8d9b18573d361672b77dc2a93b08728be85b [Core][Shipping][Behat] Update estimated shipping cost scenarios 04ab77c3ad75d6f2879e0486d167f91e02b2a52b [Core][Configuration] Add possibilty to change priorities based on configuration 225557e9c7f2eb01934c88503ce997049a34859b [Core][Configuration] Rename flag that changes priorities in order processing 12ba23573f24c125209a69885953a207398ff4c1 [Core][Configuration] Fix SyliusCoreConfigurationTest 3333d077aca47ce0f31333c01ce6fdd9b3caa833 [Core][Configuration] Refactor test cases 9fcae9e31fa9804576aa98bc6e2de2d2497ed5e1 [Core][Configuration] Rename flag that changes priorities in order processing aac69ca011fd0dd92397f460fecdc5995634afdd [Core][Shipping] Update UPGRADE-1.10.md d790944fe36a02d356a001c9bef4e16ae6da372a [Core][Configuration] Rename flag that changes priorities in order processing
- Loading branch information
Showing
5 changed files
with
132 additions
and
24 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Sylius package. | ||
* | ||
* (c) Paweł Jędrzejewski | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Sylius\Bundle\CoreBundle\Tests\DependencyInjection; | ||
|
||
use Matthias\SymfonyConfigTest\Partial\PartialProcessor; | ||
use Matthias\SymfonyConfigTest\PhpUnit\ConfigurationTestCaseTrait; | ||
use PHPUnit\Framework\TestCase; | ||
use Sylius\Bundle\CoreBundle\DependencyInjection\Configuration; | ||
use Symfony\Component\Config\Definition\Exception\InvalidTypeException; | ||
|
||
final class SyliusCoreConfigurationTest extends TestCase | ||
{ | ||
use ConfigurationTestCaseTrait; | ||
|
||
/** @test */ | ||
public function it_does_not_bring_back_previous_priorities_for_order_processing_by_default(): void | ||
{ | ||
$this->assertProcessedConfigurationEquals( | ||
[[]], | ||
['process_shipments_before_recalculating_prices' => false], | ||
'process_shipments_before_recalculating_prices', | ||
); | ||
} | ||
|
||
/** @test */ | ||
public function it_allows_to_define_that_previous_priorities_should_be_brought_back_for_order_processing(): void | ||
{ | ||
$this->assertProcessedConfigurationEquals( | ||
[['process_shipments_before_recalculating_prices' => true]], | ||
['process_shipments_before_recalculating_prices' => true], | ||
'process_shipments_before_recalculating_prices', | ||
); | ||
} | ||
|
||
/** @test */ | ||
public function it_does_not_allow_to_define_previous_priorities_with_values_other_then_bool(): void | ||
{ | ||
$this->expectException(InvalidTypeException::class); | ||
|
||
(new PartialProcessor())->processConfiguration( | ||
$this->getConfiguration(), | ||
'process_shipments_before_recalculating_prices', | ||
[['process_shipments_before_recalculating_prices' => 'yolo']] | ||
); | ||
} | ||
|
||
protected function getConfiguration(): Configuration | ||
{ | ||
return new Configuration(); | ||
} | ||
} |
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