Skip to content

Commit

Permalink
428 - Test coverage: GetAvailableShippingMethodsTest
Browse files Browse the repository at this point in the history
  • Loading branch information
atwixfirster committed Mar 14, 2019
1 parent 4ed4d59 commit 89a8621
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 79 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,15 @@ public function testGetAvailableShippingMethods()
self::assertCount(1, $response['cart']['shipping_addresses'][0]['available_shipping_methods']);

$expectedAddressData = [
'amount' => 10,
'base_amount' => 10,
'amount' => 0,
'base_amount' => 0,
'carrier_code' => 'flatrate',
'carrier_title' => 'Flat Rate',
'error_message' => '',
'method_code' => 'flatrate',
'method_title' => 'Fixed',
'price_incl_tax' => 10,
'price_excl_tax' => 10,
'price_incl_tax' => 0,
'price_excl_tax' => 0,
];
self::assertEquals(
$expectedAddressData,
Expand Down Expand Up @@ -105,7 +105,7 @@ public function testGetAvailableShippingMethodsFromAnotherCustomerCart()
* Test case: get available shipping methods when all shipping methods are disabled
*
* @magentoApiDataFixture Magento/Checkout/_files/quote_with_address_saved.php
* @magentoApiDataFixture Magento/Checkout/_files/disable_all_active_shipping_methods.php
* @magentoApiDataFixture Magento/OfflineShipping/_files/disable_offline_shipping_methods.php
*/
public function testGetAvailableShippingMethodsIfShippingsAreNotSet()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public function testGetAvailableShippingMethodsFromAnotherCustomerCart()
* Test case: get available shipping methods when all shipping methods are disabled
*
* @magentoApiDataFixture Magento/Sales/_files/guest_quote_with_addresses.php
* @magentoApiDataFixture Magento/Checkout/_files/disable_all_active_shipping_methods.php
* @magentoApiDataFixture Magento/OfflineShipping/_files/disable_offline_shipping_methods.php
*/
public function testGetAvailableShippingMethodsIfShippingsAreNotSet()
{
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);

use Magento\Framework\App\Config\Storage\Writer;
use Magento\Framework\App\Config\Storage\WriterInterface;
use Magento\TestFramework\Helper\Bootstrap;
use Magento\Framework\App\Config\ScopeConfigInterface;

$objectManager = Bootstrap::getObjectManager();
/** @var Writer $configWriter */
$configWriter = $objectManager->get(WriterInterface::class);

$configWriter->save('carriers/flatrate/active', 0);
$configWriter->save('carriers/tablerate/active', 0);
$configWriter->save('carriers/freeshipping/active', 0);

$scopeConfig = $objectManager->get(ScopeConfigInterface::class);
$scopeConfig->clean();
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);

use Magento\Framework\App\Config\Storage\Writer;
use Magento\Framework\App\Config\Storage\WriterInterface;
use Magento\TestFramework\Helper\Bootstrap;

$objectManager = Bootstrap::getObjectManager();
/** @var Writer $configWriter */
$configWriter = $objectManager->create(WriterInterface::class);

$configWriter->delete('carriers/flatrate/active');
$configWriter->delete('carriers/tablerate/active');
$configWriter->delete('carriers/freeshipping/active');
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
$product = $objectManager->create(\Magento\Catalog\Model\Product::class);
$product->setTypeId('simple')
->setAttributeSetId($product->getDefaultAttributeSetId())
->setName('Simple Product')
->setName('Simple Product For Guest Quote')
->setSku('simple-product-guest-quote')
->setPrice(10)
->setTaxClassId(0)
Expand Down

0 comments on commit 89a8621

Please sign in to comment.