Skip to content

Commit

Permalink
[Form] tweaked previous merge
Browse files Browse the repository at this point in the history
  • Loading branch information
fabpot committed Oct 25, 2012
1 parent 13319da commit 3138332
Showing 1 changed file with 6 additions and 8 deletions.
Expand Up @@ -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');
Expand All @@ -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')),
);
}
}

0 comments on commit 3138332

Please sign in to comment.