You are here

function UbercartCartLinksTestCase::setCartLinksUIRestrictions in Ubercart 6.2

Same name and namespace in other branches
  1. 7.3 uc_cart_links/tests/uc_cart_links.test \UbercartCartLinksTestCase::setCartLinksUIRestrictions()

Sets allowed cart links.

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

Parameters

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

1 call to UbercartCartLinksTestCase::setCartLinksUIRestrictions()
UbercartCartLinksTestCase::testCartLinksRestrictions in uc_cart_links/uc_cart_links.test
Tests cart links on a page under a variety of conditions.

File

uc_cart_links/uc_cart_links.test, line 656
Ubercart Cart Links Tests.

Class

UbercartCartLinksTestCase
SimpleTests for Ubercart Cart Links.

Code

function setCartLinksUIRestrictions($restrictions = '') {
  $this
    ->drupalPost('admin/store/settings/cart_links', array(
    'uc_cart_links_restrictions' => $restrictions,
  ), t('Save configuration'));
  $this
    ->assertFieldByName('uc_cart_links_restrictions', $restrictions, t('Cart links restrictions contains "@restrictions".', array(
    '@restrictions' => $restrictions,
  )));
}