You are here

protected function CartLinksTest::setCartLinksUiAllowEmptying in Ubercart 8.4

Sets checkbox to allow Cart Links to empty cart.

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.

1 call to CartLinksTest::setCartLinksUiAllowEmptying()
CartLinksTest::testCartLinksAllowEmptying in uc_cart_links/src/Tests/CartLinksTest.php
Tests Cart Links cart empty action.

File

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

Class

CartLinksTest
Tests the Cart Links functionality.

Namespace

Drupal\uc_cart_links\Tests

Code

protected function setCartLinksUiAllowEmptying($state = TRUE) {
  $this
    ->drupalPostForm('admin/store/config/cart-links', [
    'uc_cart_links_empty' => $state,
  ], 'Save configuration');
  $this
    ->assertFieldByName('uc_cart_links_empty', $state, SafeMarkup::format('Allow Cart Links to empty carts is @state.', [
    '@state' => $state ? 'TRUE' : 'FALSE',
  ]));
}