You are here

protected function UbercartCartLinksTestCase::createCartLinksPage in Ubercart 7.3

Same name and namespace in other branches
  1. 6.2 uc_cart_links/uc_cart_links.test \UbercartCartLinksTestCase::createCartLinksPage()

Create a page with Cart Links in the body.

Parameters

$links: Array of Cart Links to appear on page.

6 calls to UbercartCartLinksTestCase::createCartLinksPage()
UbercartCartLinksTestCase::testCartLinksAllowEmptying in uc_cart_links/tests/uc_cart_links.test
Tests Cart Links cart empty action.
UbercartCartLinksTestCase::testCartLinksBasicFunctionality in uc_cart_links/tests/uc_cart_links.test
Tests Cart Links on a page under a variety of conditions.
UbercartCartLinksTestCase::testCartLinksMessages in uc_cart_links/tests/uc_cart_links.test
Tests Cart Links messages.
UbercartCartLinksTestCase::testCartLinksProductActionMessage in uc_cart_links/tests/uc_cart_links.test
Tests Cart Links product action messages.
UbercartCartLinksTestCase::testCartLinksRestrictions in uc_cart_links/tests/uc_cart_links.test
Tests Cart Links restrictions.

... See full list

File

uc_cart_links/tests/uc_cart_links.test, line 670
Ubercart Cart Links Tests.

Class

UbercartCartLinksTestCase
SimpleTests for Ubercart Cart Links.

Code

protected function createCartLinksPage($links = array()) {
  if (!empty($links)) {
    $i = 0;
    foreach ($links as $link) {
      $body['links'][] = array(
        'title' => t('Cart Link #@num', array(
          '@num' => $i++,
        )),
        'href' => $link,
      );
    }
  }
  $page = array(
    'type' => 'page',
    // This is default anyway ...
    'body' => array(
      LANGUAGE_NONE => array(
        array(
          'value' => isset($body) ? theme('links', $body) : $this
            ->randomName(128),
          'format' => filter_default_format(),
        ),
      ),
    ),
  );
  return $this
    ->drupalCreateNode($page);
}