OrderBrowserTestBase.php in Commerce Core 8.2
File
modules/order/tests/src/Functional/OrderBrowserTestBase.php
View source
<?php
namespace Drupal\Tests\commerce_order\Functional;
use Drupal\Tests\commerce\Functional\CommerceBrowserTestBase;
abstract class OrderBrowserTestBase extends CommerceBrowserTestBase {
protected $variation;
public static $modules = [
'commerce_product',
'commerce_order',
'commerce_order_test',
'inline_entity_form',
];
protected function getAdministratorPermissions() {
return array_merge([
'administer commerce_order',
'administer commerce_order_type',
'access commerce_order overview',
], parent::getAdministratorPermissions());
}
protected function setUp() : void {
parent::setUp();
$this->variation = $this
->createEntity('commerce_product_variation', [
'type' => 'default',
'sku' => $this
->randomMachineName(),
'price' => [
'number' => 999,
'currency_code' => 'USD',
],
]);
$this
->createEntity('commerce_product', [
'type' => 'default',
'title' => $this
->randomMachineName(),
'stores' => [
$this->store,
],
'variations' => [
$this->variation,
],
]);
}
}