You are here

public function LinkFieldAttributesTest::testFormatterPlainTitle in Link 7

Formatter Plain Title.

File

tests/LinkFieldAttributesTest.test, line 542
Field attributes test.

Class

LinkFieldAttributesTest
Field attributes test.

Code

public function testFormatterPlainTitle() {
  $content_type_friendly = $this
    ->randomName(20);
  $content_type_machine = strtolower($this
    ->randomName(10));
  $this
    ->drupalCreateContentType(array(
    'type' => $content_type_machine,
    'name' => $content_type_friendly,
  ));

  // Now add a singleton field.
  $single_field_name_friendly = $this
    ->randomName(20);
  $single_field_name_machine = strtolower($this
    ->randomName(10));

  // $single_field_name = 'field_'. $single_field_name_machine;.
  $this
    ->createSimpleLinkField($single_field_name_machine, $single_field_name_friendly, $content_type_machine);

  // Okay, now we want to make sure this display is changed:
  $this
    ->drupalGet('admin/structure/types/manage/' . $content_type_machine . '/display');
  $edit = array(
    'fields[field_' . $single_field_name_machine . '][label]' => 'above',
    'fields[field_' . $single_field_name_machine . '][type]' => 'link_title_plain',
  );
  $this
    ->drupalPost(NULL, $edit, t('Save'));
  $this
    ->createNodeTypeUser($content_type_machine);
  $link_text = 'Display';
  $link_url = 'http://www.example.com/';
  $this
    ->createNodeForTesting($content_type_machine, $content_type_friendly, $single_field_name_machine, $link_text, $link_url);
  $this
    ->assertText($link_text);
  $this
    ->assertNoText($link_url);
  $this
    ->assertNoLinkByHref($link_url);
}