protected function AlterProductEventTest::setUp in Commerce Google Tag Manager 8.2
Same name and namespace in other branches
- 8 tests/src/Kernel/AlterProductEventTest.php \Drupal\Tests\commerce_google_tag_manager\Kernel\AlterProductEventTest::setUp()
Overrides CommerceKernelTestBase::setUp
File
- tests/
src/ Kernel/ AlterProductEventTest.php, line 48
Class
- AlterProductEventTest
- @coversDefaultClass \Drupal\commerce_google_tag_manager\Event\AlterProductEvent
Namespace
Drupal\Tests\commerce_google_tag_manager\KernelCode
protected function setUp() : void {
parent::setUp();
// The variations to test with.
$this->variation = ProductVariation::create([
'type' => 'default',
'sku' => $this
->randomString(10),
'status' => TRUE,
]);
$this->variation
->save();
$this->product = new Product();
$this->product
->setName($this
->randomString(16))
->setId(1)
->setVariant($this->variation
->getTitle())
->setPrice('11.99');
}