This repository has been archived by the owner on May 8, 2024. It is now read-only.
forked from zendframework/zendframework
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'hotfix/zendframework#6207-underscore-naming-strategy-no…
…t-studlycase' Close zendframework#6207
- Loading branch information
Showing
2 changed files
with
33 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
tests/ZendTest/Stdlib/Hydrator/NamingStrategy/UnderscoreNamingStrategyTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
/** | ||
* Zend Framework (http://framework.zend.com/) | ||
* | ||
* @link http://github.com/zendframework/zf2 for the canonical source repository | ||
* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) | ||
* @license http://framework.zend.com/license/new-bsd New BSD License | ||
*/ | ||
|
||
namespace ZendTest\Stdlib\Hydrator\NamingStrategy; | ||
|
||
use Zend\Stdlib\Hydrator\NamingStrategy\UnderscoreNamingStrategy; | ||
|
||
/** | ||
* Unit tests for {@see \Zend\Stdlib\Hydrator\NamingStrategy\UnderscoreNamingStrategy} | ||
* | ||
* @covers \Zend\Stdlib\Hydrator\NamingStrategy\UnderscoreNamingStrategy | ||
*/ | ||
class UnderscoreNamingStrategyTest extends \PHPUnit_Framework_TestCase | ||
{ | ||
public function testNameHydratesToCamelCase() | ||
{ | ||
$strategy = new UnderscoreNamingStrategy(); | ||
$this->assertEquals('fooBarBaz', $strategy->hydrate('foo_bar_baz')); | ||
} | ||
|
||
public function testNameExtractsToUnderscore() | ||
{ | ||
$strategy = new UnderscoreNamingStrategy(); | ||
$this->assertEquals('foo_bar_baz', $strategy->extract('fooBarBaz')); | ||
} | ||
} |