public function UbercartCartSettingsTestCase::testCartBreadcrumb in Ubercart 7.3
Same name and namespace in other branches
- 6.2 uc_cart/uc_cart.test \UbercartCartSettingsTestCase::testCartBreadcrumb()
Tests the shopping cart page breadcrumb.
File
- uc_cart/
tests/ uc_cart.test, line 799 - Shopping cart and checkout tests.
Class
- UbercartCartSettingsTestCase
- Tests the cart settings page.
Code
public function testCartBreadcrumb() {
$this
->drupalLogin($this->adminUser);
$this
->drupalGet('admin/store/settings/cart');
$this
->assertField('uc_cart_breadcrumb_text', t('Custom cart breadcrumb text field exists'));
$this
->assertField('uc_cart_breadcrumb_url', t('Custom cart breadcrumb URL'));
$settings = array(
'uc_cart_breadcrumb_text' => $this
->randomName(8),
'uc_cart_breadcrumb_url' => $this
->randomName(7),
);
$this
->drupalPost(NULL, $settings, t('Save configuration'));
$this
->drupalPost('node/' . $this->product->nid, array(), t('Add to cart'));
$this
->assertLink($settings['uc_cart_breadcrumb_text'], 0, t('The breadcrumb link text is set correctly.'));
$links = $this
->xpath('//a[@href="' . url($settings['uc_cart_breadcrumb_url']) . '"]');
$this
->assertTrue(isset($links[0]), t('The breadcrumb link is set correctly.'));
}