function LinkAttributeCrudTest::test_Link_With_Title_Attribute in Link 6.2
File
- tests/
link.attribute.test, line 325 - Basic simpletests to test options on link module.
Class
Code
function test_Link_With_Title_Attribute() {
$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',
'title' => 'test_title',
),
);
$field = $this
->createField($field_settings, 0);
$field_db_info = content_database_info($field);
$this
->acquireNodes(1);
$node = node_load($this->nodes[0]->nid);
$this
->drupalGet('node/' . $this->nodes[0]->nid);
$edit = array();
$edit[$field['field_name'] . '[0][url]'] = 'http://www.example.com/test';
$this
->drupalPost('node/' . $this->nodes[0]->nid . '/edit', $edit, t('Save'));
// Make sure we get a new version!
$node = node_load($this->nodes[0]->nid, NULL, TRUE);
$this
->assertText(t('@type @title has been updated.', array(
'@title' => $node->title,
'@type' => $this->content_types[0]->name,
)));
$this
->drupalGet('node/' . $node->nid);
$this
->assertRaw(' title="test_title"', "Do we show the title?");
//$this->assertRaw(l('http://www.example.com/test', 'http://www.example.com/test', array('attributes' => array('title' => 'test_title'))));
}