[Tests] Added tests for PropelInflector class
This commit is contained in:
parent
85849bfe33
commit
7b218eaaca
1 changed files with 46 additions and 0 deletions
46
Tests/Util/PropelInflectorTest.php
Normal file
46
Tests/Util/PropelInflectorTest.php
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the PropelBundle package.
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*
|
||||
* @license MIT License
|
||||
*/
|
||||
|
||||
namespace Propel\PropelBundle\Tests\Util;
|
||||
|
||||
use Propel\PropelBundle\Tests\TestCase;
|
||||
use Propel\PropelBundle\Util\PropelInflector;
|
||||
|
||||
/**
|
||||
* @author William Durand <william.durand1@gmail.com>
|
||||
*/
|
||||
class PropelInflectorTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* @dataProvider dataProviderForTestCamelize
|
||||
*/
|
||||
public function testCamelize($word, $expected)
|
||||
{
|
||||
$this->assertEquals($expected, PropelInflector::camelize($word));
|
||||
}
|
||||
|
||||
public static function dataProviderForTestCamelize()
|
||||
{
|
||||
return array(
|
||||
array('', ''),
|
||||
array(null, null),
|
||||
array('foo', 'foo'),
|
||||
array('Foo', 'foo'),
|
||||
array('fooBar', 'fooBar'),
|
||||
array('FooBar', 'fooBar'),
|
||||
array('Foo_bar', 'fooBar'),
|
||||
array('Foo_Bar', 'fooBar'),
|
||||
array('Foo Bar', 'fooBar'),
|
||||
array('Foo bar Baz', 'fooBarBaz'),
|
||||
array('Foo_Bar_Baz', 'fooBarBaz'),
|
||||
array('foo_bar_baz', 'fooBarBaz'),
|
||||
);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue