public function TextSummaryTest::testFirstSentenceQuestion in Drupal 9
Same name and namespace in other branches
- 8 core/modules/text/tests/src/Kernel/TextSummaryTest.php \Drupal\Tests\text\Kernel\TextSummaryTest::testFirstSentenceQuestion()
Tests an edge case where the first sentence is a question and subsequent sentences are not. This edge case is documented at https://www.drupal.org/node/180425.
File
- core/
modules/ text/ tests/ src/ Kernel/ TextSummaryTest.php, line 44
Class
- TextSummaryTest
- Tests text_summary() with different strings and lengths.
Namespace
Drupal\Tests\text\KernelCode
public function testFirstSentenceQuestion() {
$text = 'A question? A sentence. Another sentence.';
$expected = 'A question? A sentence.';
$this
->assertTextSummary($text, $expected, NULL, 30);
}