You are here

protected function CartLinksTest::setCartLinksUiTrackClicks in Ubercart 8.4

Sets checkbox to track Cart Links clicks.

Must be logged in with 'administer cart links' permission.

Parameters

bool $state: TRUE to display product action messages, FALSE to not display. Defaults to TRUE.

File

uc_cart_links/src/Tests/CartLinksTest.php, line 585

Class

CartLinksTest
Tests the Cart Links functionality.

Namespace

Drupal\uc_cart_links\Tests

Code

protected function setCartLinksUiTrackClicks($state = TRUE) {
  $this
    ->drupalPostForm('admin/store/config/cart-links', [
    'uc_cart_links_track' => 0,
  ], 'Save configuration');
  $this
    ->assertFieldByName('uc_cart_links_track', $state ? 1 : 0, SafeMarkup::format('Track clicks is @state.', [
    '@state' => $state ? 'TRUE' : 'FALSE',
  ]));
}