forked from Sylius/Sylius
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Resolve conflict after upmerging changing processors priorities
- Loading branch information
Showing
9 changed files
with
209 additions
and
11 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
25 changes: 25 additions & 0 deletions
25
...pplying_shipping_method_rules/seeing_estimated_shipping_cost_based_on_order_total.feature
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,25 @@ | ||
@applying_shipping_method_rules | ||
Feature: Seeing estimated shipping costs based on order total | ||
In order to be aware of estimated shipping costs | ||
As a Customer | ||
I want to see estimated shipping costs that match the shipping method rule | ||
|
||
Background: | ||
Given the store operates on a single channel in "United States" | ||
And the store has a product "Cheap Jacket" priced at "$20.00" | ||
And the store has a product "Expensive Jacket" priced at "$200.00" | ||
And the store has "Ship with us, ship with pride" shipping method with "$200" fee | ||
And this shipping method is only available for orders over or equal to "$30" | ||
And the store has "We delivery cheap goodz" shipping method with "$2" fee | ||
And this shipping method is only available for orders under or equal to "$29.99" | ||
And I am a logged in customer | ||
|
||
@ui @api | ||
Scenario: Seeing valid estimated shipping cost for the cart with a value over minimum price configured on the shipping method | ||
When I add product "Expensive Jacket" to the cart | ||
Then my cart estimated shipping cost should be "$200.00" | ||
|
||
@ui @api | ||
Scenario: Seeing valid estimated shipping cost for the cart with a value under maximum price configured on the shipping method | ||
When I add product "Cheap Jacket" to the cart | ||
Then my cart estimated shipping cost should be "$2.00" |
27 changes: 27 additions & 0 deletions
27
...plying_shipping_method_rules/seeing_estimated_shipping_cost_based_on_total_weight.feature
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,27 @@ | ||
@applying_shipping_method_rules | ||
Feature: Seeing estimated shipping costs based on total weight | ||
In order to be aware of estimated shipping costs | ||
As a Customer | ||
I want to see estimated shipping costs that match the shipping method rule | ||
|
||
Background: | ||
Given the store operates on a single channel in "United States" | ||
And the store has a product "Jacket for the Lochness Monster" priced at "$1337.00" | ||
And this product's weight is 200 | ||
And the store has a product "T-Shirt for Tinkerbell" priced at "$1.00" | ||
And this product's weight is 0.1 | ||
And the store has "Heavy Duty Courier" shipping method with "$200" fee | ||
And this shipping method is only available for orders with a total weight greater or equal to 100.0 | ||
And the store has "Fairytale Delivery Service" shipping method with "$2" fee | ||
And this shipping method is only available for orders with a total weight less or equal to 1.0 | ||
And I am a logged in customer | ||
|
||
@ui @api | ||
Scenario: Seeing valid estimated shipping cost for the cart with a total weight over minimum total weight configured on the shipping method | ||
When I add product "Jacket for the Lochness Monster" to the cart | ||
Then my cart estimated shipping cost should be "$200.00" | ||
|
||
@ui @api | ||
Scenario: Seeing valid estimated shipping cost for the cart with a total weight under maximum total weight configured on the shipping method | ||
When I add product "T-Shirt for Tinkerbell" to the cart | ||
Then my cart estimated shipping cost should be "$2.00" |
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
62 changes: 62 additions & 0 deletions
62
src/Sylius/Bundle/CoreBundle/Tests/DependencyInjection/SyliusCoreConfigurationTest.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,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