Skip to content

Commit a2f8672

Browse files
committed
MC-19080: Incorrect behavior after shipping methods disabled
1 parent 08bbdbf commit a2f8672

File tree

3 files changed

+12
-8
lines changed

3 files changed

+12
-8
lines changed

dev/tests/integration/testsuite/Magento/OfflineShipping/Model/CollectRatesTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* Integration tests for offline shipping carriers.
1212
* @magentoAppIsolation enabled
1313
*/
14-
class CollectRatesTest extends \Magento\Shipping\Model\CollectRatesTest
14+
class CollectRatesTest extends \Magento\Shipping\Model\CollectRatesAbstract
1515
{
1616
/**
1717
* @var string

dev/tests/integration/testsuite/Magento/Shipping/Model/CollectRatesTest.php renamed to dev/tests/integration/testsuite/Magento/Shipping/Model/CollectRatesAbstract.php

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,10 @@
1515
use Magento\TestFramework\Helper\Bootstrap;
1616

1717
/**
18-
* Integration tests for shipping carriers.
18+
* Abstract class for testing shipping carriers.
1919
*/
20-
class CollectRatesTest extends \PHPUnit\Framework\TestCase
20+
abstract class CollectRatesAbstract extends \PHPUnit\Framework\TestCase
2121
{
22-
2322
/**
2423
* @var ObjectManagerInterface
2524
*/
@@ -45,14 +44,13 @@ class CollectRatesTest extends \PHPUnit\Framework\TestCase
4544
*/
4645
protected function setUp()
4746
{
48-
if (empty($this->carrier) || empty($this->errorMessage)) {
49-
$this->markTestSkipped('Required fields are empty');
50-
}
5147
$this->objectManager = Bootstrap::getObjectManager();
5248
$this->shipping = $this->objectManager->get(Shipping::class);
5349
}
5450

5551
/**
52+
* Tests that an error message is displayed when the shipping method is enabled and not applicable.
53+
*
5654
* @return void
5755
*/
5856
public function testCollectRatesWhenShippingCarrierIsAvailableAndNotApplicable()
@@ -65,6 +63,8 @@ public function testCollectRatesWhenShippingCarrierIsAvailableAndNotApplicable()
6563
}
6664

6765
/**
66+
* Tests that shipping rates don't return when the shipping method is disabled and not applicable.
67+
*
6868
* @return void
6969
*/
7070
public function testCollectRatesWhenShippingCarrierIsNotAvailableAndNotApplicable()
@@ -76,6 +76,8 @@ public function testCollectRatesWhenShippingCarrierIsNotAvailableAndNotApplicabl
7676
}
7777

7878
/**
79+
* Returns customer address.
80+
*
7981
* @return DataObject
8082
*/
8183
private function getAddress(): DataObject
@@ -102,6 +104,8 @@ private function getAddress(): DataObject
102104
}
103105

104106
/**
107+
* Returns shipping rate by the result.
108+
*
105109
* @param Result $result
106110
* @return Method|Error
107111
*/

dev/tests/integration/testsuite/Magento/Ups/Model/CollectRatesTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* Integration tests for online shipping carriers.
1212
* @magentoAppIsolation enabled
1313
*/
14-
class CollectRatesTest extends \Magento\Shipping\Model\CollectRatesTest
14+
class CollectRatesTest extends \Magento\Shipping\Model\CollectRatesAbstract
1515
{
1616
/**
1717
* @var string

0 commit comments

Comments
 (0)