function LinkAttributeCrudTest::testLinkWithNoFollowOnField in Link 6.2
File
- tests/
link.attribute.test, line 148 - Basic simpletests to test options on link module.
Class
Code
function testLinkWithNoFollowOnField() {
$this
->acquireContentTypes(1);
$field_settings = array(
'type' => 'link',
'widget_type' => 'link',
'type_name' => $this->content_types[0]->name,
'attributes' => array(
'class' => '',
'target' => 'default',
'rel' => 'nofollow',
),
);
$field = $this
->createField($field_settings, 0);
//$this->pass('<pre>'. print_r($field, TRUE) .'</pre>');
$field_db_info = content_database_info($field);
$this
->acquireNodes(2);
$node = node_load($this->nodes[0]->nid);
$node->promote = 1;
// We want this to show on front page for the teaser test.
$node->{$field['field_name']}[0] = $this
->createLink('http://www.example.com', 'Test Link');
node_save($node);
// Does this display on the node page?
$this
->drupalGet('node/' . $this->nodes[0]->nid);
//$this->outputScreenContents('Link field with class', 'link_');
$this
->assertLinkOnNode($field['field_name'], l('Test Link', 'http://www.example.com', array(
'attributes' => array(
'rel' => 'nofollow',
),
)));
// Does this display on the front page?
$this
->drupalGet('<front>');
// reset the zebra!
$this->zebra = 0;
$this
->assertLinkOnNode($field['field_name'], l('Test Link', 'http://www.example.com', array(
'attributes' => array(
'rel' => 'nofollow',
),
)));
}