function TextSummaryTest::testOnlyTextSummary

Test sending only summary.

File

drupal/core/modules/field/modules/text/lib/Drupal/text/Tests/TextSummaryTest.php, line 169
Definition of Drupal\text\TextSummaryTest.

Class

TextSummaryTest
Tests the text field summary.

Namespace

Drupal\text\Tests

Code

function testOnlyTextSummary() {

  // Login as article creator.
  $this
    ->drupalLogin($this->article_creator);

  // Create article with summary but empty body.
  $summary = $this
    ->randomName();
  $edit = array(
    "title" => $this
      ->randomName(),
    "body[und][0][summary]" => $summary,
  );
  $this
    ->drupalPost('node/add/article', $edit, t('Save'));
  $node = $this
    ->drupalGetNodeByTitle($edit['title']);
  $this
    ->assertIdentical($node->body['und'][0]['summary'], $summary, 'Article with with summary and no body has been submitted.');
}