ProductBrowserTestBase.php in Commerce Core 8.2
File
modules/product/tests/src/Functional/ProductBrowserTestBase.php
View source
<?php
namespace Drupal\Tests\commerce_product\Functional;
use Drupal\Tests\commerce\Functional\CommerceBrowserTestBase;
use Drupal\Tests\field\Traits\EntityReferenceTestTrait;
abstract class ProductBrowserTestBase extends CommerceBrowserTestBase {
use EntityReferenceTestTrait;
public static $modules = [
'commerce_product',
'commerce_order',
'field_ui',
'options',
'taxonomy',
];
protected $product;
protected $stores;
protected function getAdministratorPermissions() {
return array_merge([
'administer commerce_product',
'administer commerce_product_type',
'administer commerce_product fields',
'administer commerce_product_variation fields',
'administer commerce_product_variation display',
'access commerce_product overview',
], parent::getAdministratorPermissions());
}
protected function setUp() : void {
parent::setUp();
$this->stores = [
$this->store,
];
for ($i = 0; $i < 2; $i++) {
$this->stores[] = $this
->createStore();
}
foreach ($this->stores as $index => $store) {
$this->stores[$index] = $this
->reloadEntity($store);
}
}
}