ChainCheckoutFlowResolverTest.php in Commerce Core 8.2
File
modules/checkout/tests/src/Kernel/ChainCheckoutFlowResolverTest.php
View source
<?php
namespace Drupal\Tests\commerce_checkout\Kernel;
use Drupal\commerce_order\Entity\Order;
use Drupal\Tests\commerce_order\Kernel\OrderKernelTestBase;
class ChainCheckoutFlowResolverTest extends OrderKernelTestBase {
public static $modules = [
'commerce_checkout',
];
protected function setUp() : void {
parent::setUp();
$this
->installConfig('commerce_checkout');
}
public function testCheckoutFlowResolution() {
$user = $this
->createUser([
'mail' => $this
->randomString() . '@example.com',
]);
$order = Order::create([
'type' => 'default',
'mail' => $user
->getEmail(),
'uid' => $user
->id(),
'store_id' => $this->store
->id(),
]);
$order
->save();
$resolver = $this->container
->get('commerce_checkout.chain_checkout_flow_resolver');
$checkout_flow = $resolver
->resolve($order);
$this
->assertEquals('default', $checkout_flow
->id());
}
}