Skip to content

Commit

Permalink
#518 Refactored shipping selection algo classname
Browse files Browse the repository at this point in the history
  • Loading branch information
Roman Glushko committed Feb 17, 2018
1 parent 131fc1c commit 32ffc90
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
/**
* {@inheritdoc}
*
* This shipping algorithm just iterates over all the sources one by one in particular order
* This shipping algorithm just iterates over all the sources one by one in priority order
*/
class DefaultShippingAlgorithm implements ShippingAlgorithmInterface
class PriorityShippingAlgorithm implements ShippingAlgorithmInterface
{
/**
* @var SourceSelectionInterfaceFactory
Expand Down Expand Up @@ -163,7 +163,6 @@ public function execute(OrderInterface $order): ShippingAlgorithmResultInterface
}
}


return $this->shippingAlgorithmResultFactory->create([
'sourceSelections' => $sourceSelections,
'isShippable' => $isShippable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@ public function __construct(
*/
public function execute(): ShippingAlgorithmInterface
{
return $this->objectManager->get(DefaultShippingAlgorithm::class);
return $this->objectManager->get(PriorityShippingAlgorithm::class);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
namespace Magento\InventoryShipping\Test\Integration;

use Magento\InventoryCatalog\Api\DefaultSourceProviderInterface;
use Magento\InventoryShipping\Model\DefaultShippingAlgorithm;
use Magento\InventoryShipping\Model\PriorityShippingAlgorithm;
use Magento\Sales\Api\Data\OrderInterface;
use Magento\Sales\Api\Data\OrderInterfaceFactory;
use Magento\Sales\Api\Data\OrderItemInterfaceFactory;
use Magento\TestFramework\Helper\Bootstrap;
use PHPUnit\Framework\TestCase;

class DefaultShippingAlgorithmTest extends TestCase
class PriorityShippingAlgorithmTest extends TestCase
{
/**
* @var DefaultSourceProviderInterface
Expand All @@ -33,13 +33,16 @@ class DefaultShippingAlgorithmTest extends TestCase
private $orderFactory;

/**
* @var DefaultShippingAlgorithm
* @var PriorityShippingAlgorithm
*/
private $shippingAlgorithm;

/**
* @return void
*/
protected function setUp()
{
$this->shippingAlgorithm = Bootstrap::getObjectManager()->get(DefaultShippingAlgorithm::class);
$this->shippingAlgorithm = Bootstrap::getObjectManager()->get(PriorityShippingAlgorithm::class);
$this->defaultSourceProvider = Bootstrap::getObjectManager()->get(DefaultSourceProviderInterface::class);
$this->orderFactory = Bootstrap::getObjectManager()->get(OrderInterfaceFactory::class);
$this->orderItemFactory = Bootstrap::getObjectManager()->get(OrderItemInterfaceFactory::class);
Expand Down

0 comments on commit 32ffc90

Please sign in to comment.