@@ -30,6 +30,57 @@ public function testRateAppliedToShipping()
30
30
$ this ->assertEquals (0 , $ customerQuote ->getBaseGrandTotal ());
31
31
}
32
32
33
+ /**
34
+ * @magentoConfigFixture current_store carriers/tablerate/active 1
35
+ * @magentoConfigFixture current_store carriers/flatrate/active 0
36
+ * @magentoConfigFixture current_store carriers/freeshipping/active 0
37
+ * @magentoConfigFixture current_store carriers/tablerate/condition_name package_qty
38
+ * @magentoDataFixture Magento/SalesRule/_files/cart_rule_free_shipping_by_cart.php
39
+ * @magentoDataFixture Magento/Sales/_files/quote.php
40
+ * @magentoDataFixture Magento/OfflineShipping/_files/tablerates.php
41
+ * @return void
42
+ */
43
+ public function testTableRateFreeShipping ()
44
+ {
45
+ $ objectManager = \Magento \TestFramework \Helper \Bootstrap::getObjectManager ();
46
+ /** @var \Magento\Quote\Model\Quote $quote */
47
+ $ quote = $ objectManager ->get (\Magento \Quote \Model \Quote::class);
48
+ $ quote ->load ('test01 ' , 'reserved_order_id ' );
49
+ $ cartId = $ quote ->getId ();
50
+ if (!$ cartId ) {
51
+ $ this ->fail ('quote fixture failed ' );
52
+ }
53
+ /** @var \Magento\Quote\Model\QuoteIdMask $quoteIdMask */
54
+ $ quoteIdMask = \Magento \TestFramework \Helper \Bootstrap::getObjectManager ()
55
+ ->create (\Magento \Quote \Model \QuoteIdMaskFactory::class)
56
+ ->create ();
57
+ $ quoteIdMask ->load ($ cartId , 'quote_id ' );
58
+ //Use masked cart Id
59
+ $ cartId = $ quoteIdMask ->getMaskedId ();
60
+ $ data = [
61
+ 'data ' => [
62
+ 'country_id ' => "US " ,
63
+ 'postcode ' => null ,
64
+ 'region ' => null ,
65
+ 'region_id ' => null
66
+ ]
67
+ ];
68
+ /** @var \Magento\Quote\Api\Data\EstimateAddressInterface $address */
69
+ $ address = $ objectManager ->create (\Magento \Quote \Api \Data \EstimateAddressInterface::class, $ data );
70
+ /** @var \Magento\Quote\Api\GuestShippingMethodManagementInterface $shippingEstimation */
71
+ $ shippingEstimation = $ objectManager ->get (\Magento \Quote \Api \GuestShippingMethodManagementInterface::class);
72
+ $ result = $ shippingEstimation ->estimateByAddress ($ cartId , $ address );
73
+ $ this ->assertNotEmpty ($ result );
74
+ $ expectedResult = [
75
+ 'method_code ' => 'bestway ' ,
76
+ 'amount ' => 0
77
+ ];
78
+ foreach ($ result as $ rate ) {
79
+ $ this ->assertEquals ($ expectedResult ['amount ' ], $ rate ->getAmount ());
80
+ $ this ->assertEquals ($ expectedResult ['method_code ' ], $ rate ->getMethodCode ());
81
+ }
82
+ }
83
+
33
84
/**
34
85
* @magentoConfigFixture current_store carriers/tablerate/active 1
35
86
* @magentoConfigFixture current_store carriers/tablerate/condition_name package_qty
@@ -53,6 +104,7 @@ public function testEstimateByAddressWithCartPriceRuleByItem()
53
104
*/
54
105
public function testEstimateByAddressWithCartPriceRuleByShipment ()
55
106
{
107
+ $ this ->markTestSkipped ('According to MAGETWO-69940 it is an incorrect behavior ' );
56
108
// Rule applied to entire shipment should not overwrite flat or table rate shipping prices
57
109
// Only rules applied to specific items should modify those prices (MAGETWO-63844)
58
110
$ this ->executeTestFlow (5 , 10 );
0 commit comments