You are here

protected function CartLinksTest::setCartLinksUiRestrictions in Ubercart 8.4

Sets allowed Cart Links.

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

Parameters

string $restrictions: String containing user input from a textarea, one restriction per line. Restrictions are valid Cart Links - i.e. relative URLs.

1 call to CartLinksTest::setCartLinksUiRestrictions()
CartLinksTest::testCartLinksRestrictions in uc_cart_links/src/Tests/CartLinksTest.php
Tests Cart Links restrictions.

File

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

Class

CartLinksTest
Tests the Cart Links functionality.

Namespace

Drupal\uc_cart_links\Tests

Code

protected function setCartLinksUiRestrictions($restrictions = '') {
  $this
    ->drupalPostForm('admin/store/config/cart-links', [
    'uc_cart_links_restrictions' => $restrictions,
  ], 'Save configuration');
  $this
    ->assertFieldByName('uc_cart_links_restrictions', $restrictions, SafeMarkup::format('Cart Links restrictions contains "@restrictions".', [
    '@restrictions' => $restrictions,
  ]));
}