Files
Phraseanet/tests/Alchemy/Tests/Phrasea/Utilities/String/CrLfNormalizerTest.php
Jean-Yves Gaulier d012978508 PHRAS-504 #time 8h
fix: prod / cr-lf in metadata is ok for aggregate  filter
cr,lf,crlf are normalized
- getting field values from recordadapter
- during es indexation (direct sql read in metadata...)
- before querying
2015-07-15 11:10:38 +02:00

34 lines
739 B
PHP

<?php
namespace Alchemy\Tests\Phrasea\Utilities\String;
use Alchemy\Phrasea\Utilities\StringHelper;
/**
* @group functional
* @group legacy
*/
class CrLfNormalizerTest extends \PhraseanetTestCase
{
/**
* @dataProvider provideStrings
* @covers Alchemy\Phrasea\Utilities\StringHelper::crlfNormalize
*/
public function testCrLfNormalize($string, $expected)
{
$result = StringHelper::crlfNormalize($string);
$this->assertEquals($expected, $result);
}
public function provideStrings()
{
return [
['ABC\rDEF', 'ABC\nDEF'],
['ABC\nDEF', 'ABC\nDEF'],
['ABC\r\nDEF', 'ABC\nDEF'],
['ABC\n\rDEF', 'ABC\n\nDEF'],
];
}
}