Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 201150e

Browse files
committed
Add StringUtil::trim test case for an emoji
1 parent 0d35d24 commit 201150e

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

src/Symfony/Component/Form/Tests/Util/StringUtilTest.php

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,20 @@
1616

1717
class StringUtilTest extends TestCase
1818
{
19-
public function testTrim()
19+
public function trimProvider()
2020
{
21-
$data = ' Foo! ';
21+
return [
22+
[' Foo! ', 'Foo!'],
23+
["\u{1F92E}", "\u{1F92E}"]
24+
];
25+
}
2226

23-
$this->assertEquals('Foo!', StringUtil::trim($data));
27+
/**
28+
* @dataProvider trimProvider
29+
*/
30+
public function testTrim($data, $expectedData)
31+
{
32+
$this->assertEquals($expectedData, StringUtil::trim($data));
2433
}
2534

2635
/**

0 commit comments

Comments
 (0)