mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-23 18:03:17 +00:00

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
34 lines
739 B
PHP
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'],
|
|
];
|
|
}
|
|
}
|