public function ClassifiedTestTestBasicTest::test1265524 in Classified Ads 7.3
Bug 1265524: Can not edit taxonomy terms.
Regex in hook_url_outbound_alter() was too lax.
File
- tests/
classified_test_basic.test, line 232
Class
- ClassifiedTestTestBasicTest
- Basic test for known bugs in previous versions.
Code
public function test1265524() {
$this->group = __FUNCTION__;
$this
->createUsers(array(
'admin',
));
$this
->drupalLogin($this->adminUser);
$this
->drupalGet('admin/structure/taxonomy/classified_categories');
$links = $this
->xpath('//a[normalize-space(text())=:label]', array(
':label' => t('edit'),
));
// 2 categories created on install.
$this
->assert(count($links) == 2, t('Found 2 "edit" links'), $this->group);
$pattern = 'taxonomy/term/*/edit';
foreach ($links as $link) {
$href = (string) $link['href'];
$href = $this
->relativizeHref($href);
$parsed = drupal_parse_url($href);
$path = $parsed['path'];
$this
->assertTrue(drupal_match_path($path, $pattern), t('Path %path matches %pattern', array(
'%path' => $path,
'%pattern' => $pattern,
)), $this->group);
}
}