function TextSummaryTest::callTextSummary

Calls text_summary() and asserts that the expected teaser is returned.

3 calls to TextSummaryTest::callTextSummary()
TextSummaryTest::testFirstSentenceQuestion in drupal/core/modules/field/modules/text/lib/Drupal/text/Tests/TextSummaryTest.php
Tests an edge case where the first sentence is a question and subsequent sentences are not. This edge case is documented at http://drupal.org/node/180425.
TextSummaryTest::testLength in drupal/core/modules/field/modules/text/lib/Drupal/text/Tests/TextSummaryTest.php
Test various summary length edge cases.
TextSummaryTest::testLongSentence in drupal/core/modules/field/modules/text/lib/Drupal/text/Tests/TextSummaryTest.php
Test summary with long example.

File

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

Class

TextSummaryTest
Tests the text field summary.

Namespace

Drupal\text\Tests

Code

function callTextSummary($text, $expected, $format = NULL, $size = NULL) {
  $summary = text_summary($text, $format, $size);
  $this
    ->assertIdentical($summary, $expected, t('Generated summary "@summary" matches expected "@expected".', array(
    '@summary' => $summary,
    '@expected' => $expected,
  )));
}