public function testInvalidFilterFormat() { $this->
assertTextSummary($this->
randomString(100
), '', 'non_existent_format'
);
} /**
* Calls text_summary() and asserts that the expected teaser is returned.
*
* @internal
*/
public function assertTextSummary(string
$text, string
$expected, ?string
$format = NULL, int
$size = NULL
): void
{ $summary =
text_summary($text,
$format,
$size);
$this->
assertSame($expected,
$summary,
new FormattableMarkup('<pre style="white-space: pre-wrap">@actual</pre> is identical to <pre style="white-space: pre-wrap">@expected</pre>',
['@actual' =>
$summary, '@expected' =>
$expected]));
} /**
* Tests required summary.
*/
public function testRequiredSummary() { $this->
installEntitySchema('entity_test'
);
$this->
setUpCurrentUser();
$field_definition = FieldStorageConfig::
create([ 'field_name' => 'test_textwithsummary',