function LinkAttributeCrudTest::testLinkWithNoFollowOnFieldTargetNewWindow in Link 6.2
File
- tests/link.attribute.test, line 184
- Basic simpletests to test options on link module.
Class
- LinkAttributeCrudTest
Code
function testLinkWithNoFollowOnFieldTargetNewWindow() {
$this
->acquireContentTypes(1);
$field_settings = array(
'type' => 'link',
'widget_type' => 'link',
'type_name' => $this->content_types[0]->name,
'attributes' => array(
'class' => '',
'target' => LINK_TARGET_NEW_WINDOW,
'rel' => 'nofollow',
),
);
$field = $this
->createField($field_settings, 0);
$field_db_info = content_database_info($field);
$this
->acquireNodes(2);
$node = node_load($this->nodes[0]->nid);
$node->promote = 1;
$node->{$field['field_name']}[0] = $this
->createLink('http://www.example.com', 'Test Link');
node_save($node);
$this
->drupalGet('node/' . $this->nodes[0]->nid);
$this
->assertLinkOnNode($field['field_name'], l('Test Link', 'http://www.example.com', array(
'attributes' => array(
'target' => '_blank',
'rel' => 'nofollow',
),
)));
$this
->drupalGet('<front>');
$this->zebra = 0;
$this
->assertLinkOnNode($field['field_name'], l('Test Link', 'http://www.example.com', array(
'attributes' => array(
'target' => '_blank',
'rel' => 'nofollow',
),
)));
}