function RedirectFunctionalTest::testPathAddOverwriteRedirects in Redirect 7
Same name and namespace in other branches
- 7.2 redirect.test \RedirectFunctionalTest::testPathAddOverwriteRedirects()
File
- ./redirect.test, line 307
- Unit tests for the redirect module.
Class
- RedirectFunctionalTest
Code
function testPathAddOverwriteRedirects() {
$first_node = $this
->drupalCreateNode(array(
'type' => 'article',
'path' => array(
'alias' => 'first-alias',
),
));
$this
->drupalPost("node/{$first_node->nid}/edit", array(
'path[alias]' => 'second-alias',
), t('Save'));
$second_node = $this
->drupalCreateNode(array(
'type' => 'article',
'path' => array(
'alias' => 'first-alias',
),
));
$this
->drupalGet('first-alias');
$this
->assertNoText($first_node->title, 'Adding a new path alias that matches an existing redirect disables the redirect.');
$this
->assertText($second_node->title, 'Adding a new path alias that matches an existing redirect disables the redirect.');
}