Add more TextTruncator tests

This will take it to 100% coverage.

Change-Id: I835ac5795f15c65f07f47e9c00295d391dbf90ab
This commit is contained in:
Max Semenik 2019-07-17 20:29:00 -07:00
parent ed0f255d9f
commit c0b9bd8b77

View file

@ -58,6 +58,21 @@ class TextTruncatorTest extends \PHPUnit\Framework\TestCase {
1,
'',
],
'0 sentences mean empty result' => [
'Foo is a bar. Such a smart boy.',
0,
'',
],
"Don't explode on negative input" => [
'Foo is a bar. Such a smart boy.',
-1,
'',
],
'More sentences requested than is available' => [
'Foo is a bar. Such a smart boy.',
3,
'Foo is a bar. Such a smart boy.',
],
// Exclamation points too!!!
[
'Foo is a bar! Such a smart boy! But completely useless!',