mirror of
https://github.com/getgrav/grav.git
synced 2026-03-16 09:31:05 +01:00
Add truncate and truncateHtml tests for input type
This commit is contained in:
@@ -109,6 +109,7 @@ class UtilsTest extends \Codeception\TestCase\Test
|
||||
$this->assertEquals('english', Utils::truncate('english'));
|
||||
$this->assertEquals('This is a string to truncate', Utils::truncate('This is a string to truncate'));
|
||||
$this->assertEquals('This ', Utils::truncate('This is a string to truncate', 3, true));
|
||||
$this->assertEquals('<input ', Utils::truncate('<input type="file" id="file" multiple />', 6, true));
|
||||
|
||||
}
|
||||
|
||||
@@ -123,6 +124,7 @@ class UtilsTest extends \Codeception\TestCase\Test
|
||||
{
|
||||
$this->assertEquals('<p>T…</p>', Utils::truncateHtml('<p>This is a string to truncate</p>', 1));
|
||||
$this->assertEquals('<p>This…</p>', Utils::truncateHtml('<p>This is a string to truncate</p>', 4));
|
||||
$this->assertEquals('', Utils::truncateHtml('<input type="file" id="file" multiple />', 6, true));
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user