Skip to content

Commit

Permalink
Fix truncator tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rhukster committed Aug 6, 2018
1 parent e1b5875 commit 08cb311
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/unit/Grav/Common/UtilsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,16 +109,16 @@ public function testTruncate()
$this->assertEquals('engli' . '...', Utils::truncate('english', 5, true, " ", "..."));
$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));
$this->assertEquals('This' . '&hellip;', Utils::truncate('This is a string to truncate', 3, true));
$this->assertEquals('<input' . '&hellip;', Utils::truncate('<input type="file" id="file" multiple />', 6, true));

}

public function testSafeTruncate()
{
$this->assertEquals('This ', Utils::safeTruncate('This is a string to truncate', 1));
$this->assertEquals('This ', Utils::safeTruncate('This is a string to truncate', 4));
$this->assertEquals('This is ', Utils::safeTruncate('This is a string to truncate', 5));
$this->assertEquals('This' . '&hellip;', Utils::safeTruncate('This is a string to truncate', 1));
$this->assertEquals('This' . '&hellip;', Utils::safeTruncate('This is a string to truncate', 4));
$this->assertEquals('This is' . '&hellip;', Utils::safeTruncate('This is a string to truncate', 5));
}

public function testTruncateHtml()
Expand Down

0 comments on commit 08cb311

Please sign in to comment.