From 3138332152bf3c63f47717aa3298c9ccee444f21 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Thu, 25 Oct 2012 15:42:46 +0200 Subject: [PATCH] [Form] tweaked previous merge --- .../Core/EventListener/TrimListenerTest.php | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/Symfony/Component/Form/Tests/Extension/Core/EventListener/TrimListenerTest.php b/src/Symfony/Component/Form/Tests/Extension/Core/EventListener/TrimListenerTest.php index df8f32700104..a5771119fb89 100644 --- a/src/Symfony/Component/Form/Tests/Extension/Core/EventListener/TrimListenerTest.php +++ b/src/Symfony/Component/Form/Tests/Extension/Core/EventListener/TrimListenerTest.php @@ -50,13 +50,13 @@ public function testTrimSkipNonStrings() /** * @dataProvider codePointProvider */ - public function testTrimUtf8($description, $chars) + public function testTrimUtf8($chars) { if (!function_exists('mb_check_encoding')) { $this->markTestSkipped('The "mb_check_encoding" function is not available'); } - $data = mb_convert_encoding(pack('H*', implode('', (array)$chars)), 'UTF-8', 'UCS-2BE'); + $data = mb_convert_encoding(pack('H*', implode('', $chars)), 'UTF-8', 'UCS-2BE'); $data = $data."ab\ncd".$data; $form = $this->getMock('Symfony\Component\Form\Tests\FormInterface'); @@ -65,17 +65,15 @@ public function testTrimUtf8($description, $chars) $filter = new TrimListener(); $filter->preBind($event); - $this->assertSame("ab\ncd", $event->getData(), 'TrimListener should trim character(s): '.$description.': '.implode(', ', $chars)); + $this->assertSame("ab\ncd", $event->getData(), 'TrimListener should trim character(s): '.implode(', ', $chars)); } public function codePointProvider() { return array( - array('General category: Separator', - array('0020', '00A0', '1680', '180E', '2000', '2001', '2002', '2003', '2004', '2005', - '2006', '2007', '2008', '2009', '200A', '2028', '2029', '202F', '205F', '3000')), - array('General category: Other, control', array('0009', '000A', '000B', '000C', '000D', '0085')), -// array('General category: Other, format. ZERO WIDTH SPACE', '200B') + 'General category: Separator' => array(array('0020', '00A0', '1680', '180E', '2000', '2001', '2002', '2003', '2004', '2005', '2006', '2007', '2008', '2009', '200A', '2028', '2029', '202F', '205F', '3000')), + 'General category: Other, control' => array(array('0009', '000A', '000B', '000C', '000D', '0085')), + //'General category: Other, format. ZERO WIDTH SPACE' => array(array('200B')), ); } }