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
This commit is contained in:
Jean-Yves Gaulier
2015-07-13 17:08:36 +02:00
parent 85283c1b90
commit d012978508
13 changed files with 254 additions and 179 deletions

View File

@@ -2,7 +2,7 @@
namespace Alchemy\Tests\Phrasea\Utilities\String;
use Alchemy\Phrasea\Utilities\String\Camelizer;
use Alchemy\Phrasea\Utilities\StringHelper;
/**
* @group functional
@@ -12,12 +12,11 @@ class CamelizerTest extends \PhraseanetTestCase
{
/**
* @dataProvider provideStrings
* @covers Alchemy\Phrasea\Utilities\String\Camelizer::camelize
* @covers Alchemy\Phrasea\Utilities\StringHelper::camelize
*/
public function testCamelize($string, $separator, $expected, $pascalize)
{
$camelizer = new Camelizer();
$result = $camelizer->camelize($string, $separator, $pascalize);
$result = StringHelper::camelize($string, $separator, $pascalize);
$this->assertEquals($expected, $result);
}

View File

@@ -0,0 +1,33 @@
<?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'],
];
}
}