forked from DPDBaltics/PrestaShop-1.7
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #56 from Invertus/DGS-171
Dgs 171 Trim remark length and non-ASCII chars converted to ASCII chars
- Loading branch information
Showing
3 changed files
with
113 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
|
||
use Invertus\dpdBaltics\Util\StringUtility; | ||
|
||
class StringUtilityTest extends PHPUnit_Framework_TestCase | ||
{ | ||
public function testTrimString(){ | ||
$stringDataMock ="Nam quis nulla. Integer malesuada. In in enim a arcu imperdiet malesuada. Sed vel lectus."; | ||
|
||
$expectation = "Nam quis nulla. Integer malesuada. In in eni..."; | ||
|
||
$stringUtility = new StringUtility(); | ||
$trimmedTestString = $stringUtility->trimString($stringDataMock); | ||
|
||
$this->assertSame($trimmedTestString, $expectation); | ||
} | ||
|
||
public function testRemoveSpecialCharacters() { | ||
$stringDataMock ="vėlyvųjų viduramžių standartas"; | ||
$stringUtility = new StringUtility(); | ||
$formattedTestString = $stringUtility->removeSpecialCharacters($stringDataMock); | ||
$expectation = "velyvuju viduramziu standartas"; | ||
$this->assertEquals( $expectation, $formattedTestString); | ||
} | ||
|
||
} |