forked from sonata-project/SonataAdminBundle
-
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.
Add more methods to the AdminInterface, Fix test
- Loading branch information
Thomas Rabaix
committed
Nov 14, 2011
1 parent
c7ec444
commit f1fb569
Showing
4 changed files
with
199 additions
and
2 deletions.
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
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
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,24 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Sonata package. | ||
* | ||
* (c) Thomas Rabaix <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
namespace Sonata\AdminBundle\Tests\Translator; | ||
|
||
use Sonata\AdminBundle\Translator\FormLabelTranslatorStrategy; | ||
|
||
class FormLabelTranslatorStrategyTest extends \PHPUnit_Framework_TestCase | ||
{ | ||
public function testLabel() | ||
{ | ||
$strategy = new FormLabelTranslatorStrategy; | ||
|
||
$this->assertEquals('Isvalid', $strategy->getLabel('isValid')); | ||
$this->assertEquals('Plainpassword', $strategy->getLabel('plainPassword')); | ||
} | ||
} |
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,24 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of sonata-project. | ||
* | ||
* (c) 2010 Thomas Rabaix | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Sonata\AdminBundle\Translator; | ||
|
||
class FormLabelTranslatorStrategy implements LabelTranslatorStrategyInterface | ||
{ | ||
/** | ||
* @param string $label | ||
* @return string | ||
*/ | ||
public function getLabel($label) | ||
{ | ||
return ucfirst(strtolower($label)); | ||
} | ||
} |