mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-23 18:03:17 +00:00
bb changes
This commit is contained in:
@@ -1,33 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace Alchemy\Tests\Phrasea\Utilities\String;
|
|
||||||
|
|
||||||
use Alchemy\Phrasea\Utilities\StringHelper;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @group functional
|
|
||||||
* @group legacy
|
|
||||||
*/
|
|
||||||
class CamelizerTest extends \PhraseanetTestCase
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* @dataProvider provideStrings
|
|
||||||
* @covers Alchemy\Phrasea\Utilities\StringHelper::camelize
|
|
||||||
*/
|
|
||||||
public function testCamelize($string, $separator, $expected, $pascalize)
|
|
||||||
{
|
|
||||||
$result = StringHelper::camelize($string, $separator, $pascalize);
|
|
||||||
|
|
||||||
$this->assertEquals($expected, $result);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function provideStrings()
|
|
||||||
{
|
|
||||||
return [
|
|
||||||
['string-test', '-', 'stringTest', false],
|
|
||||||
['string test', ' ', 'stringTest', false],
|
|
||||||
['string_test', '_', 'stringTest', false],
|
|
||||||
['string#test', '#', 'StringTest', true],
|
|
||||||
];
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,33 +0,0 @@
|
|||||||
<?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'],
|
|
||||||
];
|
|
||||||
}
|
|
||||||
}
|
|
@@ -0,0 +1,55 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Alchemy\Tests\Phrasea\Utilities\String;
|
||||||
|
|
||||||
|
use Alchemy\Phrasea\Utilities\StringHelper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @group unit
|
||||||
|
*/
|
||||||
|
class CrLfNormalizerTest extends \PhraseanetTestCase
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @dataProvider provideStringsForCamelize
|
||||||
|
* @covers Alchemy\Phrasea\Utilities\StringHelper::camelize
|
||||||
|
*/
|
||||||
|
public function testCamelize($string, $separator, $expected, $pascalize)
|
||||||
|
{
|
||||||
|
$result = StringHelper::camelize($string, $separator, $pascalize);
|
||||||
|
|
||||||
|
$this->assertEquals($expected, $result);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function provideStringsForCamelize()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
['string-test', '-', 'stringTest', false],
|
||||||
|
['string test', ' ', 'stringTest', false],
|
||||||
|
['string_test', '_', 'stringTest', false],
|
||||||
|
['string#test', '#', 'StringTest', true],
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @dataProvider provideStringsForCrLfNormalize
|
||||||
|
* @covers Alchemy\Phrasea\Utilities\StringHelper::crlfNormalize
|
||||||
|
*/
|
||||||
|
public function testCrLfNormalize($string, $expected)
|
||||||
|
{
|
||||||
|
$result = StringHelper::crlfNormalize($string);
|
||||||
|
|
||||||
|
$this->assertEquals($expected, $result);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function provideStringsForCrLfNormalize()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
['ABC\rDEF', 'ABC\nDEF'],
|
||||||
|
['ABC\nDEF', 'ABC\nDEF'],
|
||||||
|
['ABC\r\nDEF', 'ABC\nDEF'],
|
||||||
|
['ABC\n\rDEF', 'ABC\n\nDEF'],
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user