Created
January 23, 2012 10:42
-
-
Save manuelkiessling/1662418 to your computer and use it in GitHub Desktop.
Symfony issue #3124
This file contains hidden or 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
<?php | |
/* | |
* This file is part of the Symfony package. | |
* | |
* (c) Fabien Potencier <[email protected]> | |
* | |
* For the full copyright and license information, please view the LICENSE | |
* file that was distributed with this source code. | |
*/ | |
namespace Symfony\Tests\Component\Form\Extension\Core\Type; | |
require_once __DIR__ . '/LocalizedTestCase.php'; | |
require_once __DIR__ . '/../../../../../../../../src/Symfony/Component/Form/Extension/Core/Type/MoneyType.php'; | |
class MoneyTypeTest extends LocalizedTestCase | |
{ | |
public function testPassMoneyPatternToView() | |
{ | |
\Locale::setDefault('de_DE'); | |
$form = $this->factory->create('money'); | |
$view = $form->createView(); | |
$this->assertSame('{{ widget }} €', $view->get('money_pattern')); | |
} | |
public function testPatternMatchesAllMoneyFormats() | |
{ | |
\Locale::setDefault('en_US'); | |
$currencies = require_once __DIR__ . '/../../../../../../../../src/Symfony/Component/Locale/Resources/data/stub/curr/en.php'; | |
foreach ($currencies as $currencyISO => $currency) { | |
$form = $this->factory->create('money', null, array('currency' => $currencyISO)); | |
$view = $form->createView(); | |
$this->assertTrue((bool)strstr($view->get('money_pattern'), $currency['symbol'])); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment