You are here

function TextSummaryTestCase::callTextSummary in Drupal 7

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

3 calls to TextSummaryTestCase::callTextSummary()
TextSummaryTestCase::testFirstSentenceQuestion in modules/field/modules/text/text.test
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.
TextSummaryTestCase::testLength in modules/field/modules/text/text.test
Test various summary length edge cases.
TextSummaryTestCase::testLongSentence in modules/field/modules/text/text.test
Test summary with long example.

File

modules/field/modules/text/text.test, line 384
Tests for text.module.

Class

TextSummaryTestCase

Code

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