mirror of
https://github.com/danielstjules/Stringy.git
synced 2025-08-30 16:29:58 +02:00
Add $removeUnsupported parameter to toAscii()
This commit is contained in:
@@ -203,6 +203,8 @@ abstract class CommonTest extends PHPUnit_Framework_TestCase
|
||||
array(' ', ' '), // narrow no-break space (U+202F)
|
||||
array(' ', ' '), // medium mathematical space (U+205F)
|
||||
array(' ', ' '), // ideographic space (U+3000)
|
||||
array('', '𐍉'), // some uncommon, unsupported character (U+10349)
|
||||
array('𐍉', '𐍉', false),
|
||||
);
|
||||
}
|
||||
|
||||
|
@@ -133,9 +133,9 @@ class StaticStringyTestCase extends CommonTest
|
||||
/**
|
||||
* @dataProvider toAsciiProvider()
|
||||
*/
|
||||
public function testToAscii($expected, $str)
|
||||
public function testToAscii($expected, $str, $removeUnsupported = true)
|
||||
{
|
||||
$result = S::toAscii($str);
|
||||
$result = S::toAscii($str, $removeUnsupported);
|
||||
$this->assertInternalType('string', $result);
|
||||
$this->assertEquals($expected, $result);
|
||||
}
|
||||
|
@@ -300,10 +300,10 @@ class StringyTestCase extends CommonTest
|
||||
/**
|
||||
* @dataProvider toAsciiProvider()
|
||||
*/
|
||||
public function testToAscii($expected, $str)
|
||||
public function testToAscii($expected, $str, $removeUnsupported = true)
|
||||
{
|
||||
$stringy = S::create($str);
|
||||
$result = $stringy->toAscii();
|
||||
$result = $stringy->toAscii($removeUnsupported);
|
||||
$this->assertStringy($result);
|
||||
$this->assertEquals($expected, $result);
|
||||
$this->assertEquals($str, $stringy);
|
||||
|
Reference in New Issue
Block a user