public function ProductDetailViewsTest::testMissingDefaultVariation in Commerce Google Tag Manager 8.2
Same name and namespace in other branches
- 8 tests/src/Functional/ProductDetailViewsTest.php \Drupal\Tests\commerce_google_tag_manager\Functional\ProductDetailViewsTest::testMissingDefaultVariation()
@covers ::trackProductView
Test that the module does not track the productDetailViews event if no default variation exists.
File
- tests/
src/ Functional/ ProductDetailViewsTest.php, line 105
Class
- ProductDetailViewsTest
- @coversDefaultClass \Drupal\commerce_google_tag_manager\EventSubscriber\CommerceEventsSubscriber
Namespace
Drupal\Tests\commerce_google_tag_manager\FunctionalCode
public function testMissingDefaultVariation() {
$this->product->variations = [];
$this->product
->save();
$this
->drupalGet($this->product
->toUrl()
->toString());
$this
->assertSession()
->statusCodeEquals(200);
$events = $this->tempStore
->get('events');
$this
->assertNull($events);
}