mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-23 09:53:15 +00:00
Refactor code by adding camelizer utility
This commit is contained in:

committed by
Romain Neutron

parent
383a1b0c0c
commit
45fe839cfe
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace Alchemy\Tests\Phrasea\Utilities\String;
|
||||
|
||||
use Alchemy\Phrasea\Utilities\String\Camelizer;
|
||||
|
||||
class CamelizerTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* @dataProvider provideStrings
|
||||
* @covers Alchemy\Phrasea\Utilities\String\Camelizer::camelize
|
||||
*/
|
||||
public function testCamelize($string, $separator, $expected, $pascalize)
|
||||
{
|
||||
$camelizer = new Camelizer();
|
||||
$result = $camelizer->camelize($string, $separator, $pascalize);
|
||||
|
||||
$this->assertEquals($expected, $result);
|
||||
}
|
||||
|
||||
public function provideStrings()
|
||||
{
|
||||
return array(
|
||||
array('string-test', '-', 'stringTest', false),
|
||||
array('string test', ' ', 'stringTest', false),
|
||||
array('string_test', '_', 'stringTest', false),
|
||||
array('string#test', '#', 'StringTest', true),
|
||||
);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user