function TextSummaryTest::testFirstSentenceQuestion

Same name in other branches
  1. 9 core/modules/text/tests/src/Kernel/TextSummaryTest.php \Drupal\Tests\text\Kernel\TextSummaryTest::testFirstSentenceQuestion()
  2. 8.9.x core/modules/text/tests/src/Kernel/TextSummaryTest.php \Drupal\Tests\text\Kernel\TextSummaryTest::testFirstSentenceQuestion()
  3. 10 core/modules/text/tests/src/Kernel/TextSummaryTest.php \Drupal\Tests\text\Kernel\TextSummaryTest::testFirstSentenceQuestion()

Tests text summaries for a question followed by a sentence.

File

core/modules/text/tests/src/Kernel/TextSummaryTest.php, line 46

Class

TextSummaryTest
Tests text_summary() with different strings and lengths.

Namespace

Drupal\Tests\text\Kernel

Code

public function testFirstSentenceQuestion() : void {
    $text = 'A question? A sentence. Another sentence.';
    $expected = 'A question? A sentence.';
    $this->assertTextSummary($text, $expected, NULL, 30);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.