Skip to content

Commit 50547dc

Browse files
committed
MAGETWO-59249: [Backport] - [GitHub] Free shipping rule with table shipping method breaks checkout #6346 - for 2.0
1 parent c74830d commit 50547dc

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

dev/tests/integration/testsuite/Magento/OfflineShipping/_files/tablerates.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
*/
66

77
$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
8+
/** @var \Magento\Framework\App\ResourceConnection $resource */
89
$resource = $objectManager->get(\Magento\Framework\App\ResourceConnection::class);
910
$connection = $resource->getConnection();
1011
$resourceModel = $objectManager->create(\Magento\OfflineShipping\Model\ResourceModel\Carrier\Tablerate::class);
@@ -19,9 +20,4 @@
1920
'price' => 10,
2021
'cost' => 10,
2122
];
22-
$connection->query(
23-
"INSERT INTO {$entityTable} (`website_id`, `dest_country_id`, `dest_region_id`, `dest_zip`, `condition_name`,"
24-
. "`condition_value`, `price`, `cost`) VALUES (:website_id, :dest_country_id, :dest_region_id, :dest_zip,"
25-
. " :condition_name, :condition_value, :price, :cost);",
26-
$data
27-
);
23+
$connection->insert($entityTable, $data);

dev/tests/integration/testsuite/Magento/OfflineShipping/_files/tablerates_rollback.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@
55
*/
66

77
$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
8+
/** @var \Magento\Framework\App\ResourceConnection $resource */
89
$resource = $objectManager->get(\Magento\Framework\App\ResourceConnection::class);
910
$connection = $resource->getConnection();
1011
$resourceModel = $objectManager->create(\Magento\OfflineShipping\Model\ResourceModel\Carrier\Tablerate::class);
1112
$entityTable = $resourceModel->getTable('shipping_tablerate');
12-
$connection->query("DELETE FROM {$entityTable};");
13+
$connection->delete($entityTable);

dev/tests/integration/testsuite/Magento/Quote/Model/ShippingMethodManagementTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ class ShippingMethodManagementTest extends \PHPUnit_Framework_TestCase
1919
* @magentoDataFixture Magento/SalesRule/_files/cart_rule_free_shipping.php
2020
* @magentoDataFixture Magento/Sales/_files/quote.php
2121
* @magentoDataFixture Magento/OfflineShipping/_files/tablerates.php
22+
* @return void
2223
*/
2324
public function testEstimateByAddressWithCartPriceRule()
2425
{
@@ -32,6 +33,7 @@ public function testEstimateByAddressWithCartPriceRule()
3233
* @magentoConfigFixture current_store carriers/tablerate/condition_name package_qty
3334
* @magentoDataFixture Magento/Sales/_files/quote.php
3435
* @magentoDataFixture Magento/OfflineShipping/_files/tablerates.php
36+
* @return void
3537
*/
3638
public function testEstimateByAddress()
3739
{

0 commit comments

Comments
 (0)