protected function LinkFieldAttributesTest::createNodeForTesting in Link 7
Create Node For Testing.
7 calls to LinkFieldAttributesTest::createNodeForTesting()
- LinkFieldAttributesTest::testFormatterHost in tests/
LinkFieldAttributesTest.test - Formatter Host.
- LinkFieldAttributesTest::testFormatterLabel in tests/
LinkFieldAttributesTest.test - Formatter Label.
- LinkFieldAttributesTest::testFormatterPlain in tests/
LinkFieldAttributesTest.test - Test the link_plain formatter and it's output.
- LinkFieldAttributesTest::testFormatterPlainTitle in tests/
LinkFieldAttributesTest.test - Formatter Plain Title.
- LinkFieldAttributesTest::testFormatterSeparate in tests/
LinkFieldAttributesTest.test - Formatter Separate.
File
- tests/
LinkFieldAttributesTest.test, line 209 - Field attributes test.
Class
- LinkFieldAttributesTest
- Field attributes test.
Code
protected function createNodeForTesting($content_type_machine, $content_type_friendly, $single_field_name_machine, $title, $url, $node_title = '') {
$this
->drupalGet('node/add/' . $content_type_machine);
if (!$node_title) {
$node_title = $this
->randomName(20);
}
$edit = array(
'title' => $node_title,
);
if ($url) {
$edit['field_' . $single_field_name_machine . '[und][0][url]'] = $url;
}
if ($title) {
$edit['field_' . $single_field_name_machine . '[und][0][title]'] = $title;
}
$this
->drupalPost(NULL, $edit, t('Save'));
$this
->assertText(t('@content_type_friendly @title has been created', array(
'@content_type_friendly' => $content_type_friendly,
'@title' => $node_title,
)));
}