mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/TextExtracts
synced 2024-11-15 03:35:20 +00:00
Add more TextTruncator tests
This will take it to 100% coverage. Change-Id: I835ac5795f15c65f07f47e9c00295d391dbf90ab
This commit is contained in:
parent
ed0f255d9f
commit
c0b9bd8b77
|
@ -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!',
|
||||
|
|
Loading…
Reference in a new issue