1.20.x system.test ConfirmFormTest::assertCancelLinkUrl($url, $message = '', $group = 'Other')

Asserts that a cancel link is present pointing to the provided URL.

File

modules/system/tests/system.test, line 2609
Tests for system.module.

Class

ConfirmFormTest
Tests confirm form destinations.

Code

function assertCancelLinkUrl($url, $message = '', $group = 'Other') {
  $links = $this->xpath('//a[normalize-space(text())=:label and @href=:url]', array(':label' => t('Cancel'), ':url' => $url));
  $message = ($message ? $message : format_string('Cancel link with url %url found.', array('%url' => $url)));
  return $this->assertTrue(isset($links[0]), $message, $group);
}