function TextSummaryTest::testInvalidFilterFormat

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

Test text_summary() returns an empty string without any error when called with an invalid format.

File

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

Class

TextSummaryTest
Tests <a href="/api/drupal/core%21modules%21text%21text.module/function/text_summary/8.9.x" title="Generates a trimmed, formatted version of a text field value." class="local">text_summary</a>() with different strings and lengths.

Namespace

Drupal\Tests\text\Kernel

Code

public function testInvalidFilterFormat() {
    $this->assertTextSummary($this->randomString(100), '', 'non_existent_format');
}

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