<commit_before><?php

namespace Balance\Form\Element;

use NumberFormatter;
use PHPUnit_Framework_TestCase as TestCase;

class CurrencyTest extends TestCase
{
    public function testDefaultClassAttribute()
    {
        $element = new Currency();

        $value = $element->getAttribute('class');
        $this->assertEquals('form-control-currency', $value);

        $value = $element->setAttribute('class', 'foo-bar')->getAttribute('class');
        $this->assertEquals('form-control-currency foo-bar', $value);
    }

    public function testDefaultAddOnPrependOption()
    {
        $element = new Currency();

        $symbol = (new NumberFormatter('pt_BR', NumberFormatter::CURRENCY))
            ->getSymbol(NumberFormatter::CURRENCY_SYMBOL);

        $value = $element->getOption('add-on-prepend');
        $this->assertEquals($symbol, $value);
    }
}<commit_msg>Issue #104 Alterações em testes unitários de elemento de formulário de valor monetário.<commit_after><?php

namespace Balance\Form\Element;

use Balance\Mvc\Application;
use NumberFormatter;
use PHPUnit_Framework_TestCase as TestCase;

class CurrencyTest extends TestCase
{
    public function testDefaultClassAttribute()
    {
        $element = new Currency();

        $value = $element->getAttribute('class');
        $this->assertEquals('form-control-currency', $value);

        $value = $element->setAttribute('class', 'foo-bar')->getAttribute('class');
        $this->assertEquals('form-control-currency foo-bar', $value);
    }

    public function testDefaultAddOnPrependOption()
    {
        $element = new Currency();

        $symbol = Application::getApplication()->getServiceManager()->get('i18n')
            ->createNumberFormatter(NumberFormatter::CURRENCY)
            ->getSymbol(NumberFormatter::CURRENCY_SYMBOL);

        $value = $element->getOption('add-on-prepend');
        $this->assertEquals($symbol, $value);
    }
}
{'fraction_non_alphanumeric': 0.1375, 'fraction_numerical': 0.0026041666666666665, 'mean_word_length': 3.6853658536585368, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 22, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6611411', 'n_tokens_mistral': 534, 'n_tokens_neox': 522, 'n_words': 101}