You are here

class CurrencyFormatterTest in Currency 7.2

Tests \BartFeenstra\CLDR\CurrencyFormatter

Hierarchy

  • class \BartFeenstra\Tests\CLDR\CurrencyFormatterTest extends \BartFeenstra\Tests\CLDR\PHPUnit_Framework_TestCase

Expanded class hierarchy of CurrencyFormatterTest

File

currency/vendor/bartfeenstra/cldr/src/BartFeenstra/Tests/CLDR/CurrencyFormatterTest.php, line 17
Contains class \BartFeenstra\Tests\CLDR\CurrencyFormatterTest.

Namespace

BartFeenstra\Tests\CLDR
View source
class CurrencyFormatterTest extends \PHPUnit_Framework_TestCase {

  /**
   * Test amount formatting.
   */
  function testFormat() {
    $formatter = new CurrencyFormatter('¤0.00');
    $currency_sign = '€';
    $number = 123456.789;
    $result_expected = $currency_sign . '123456.789';
    $result = $formatter
      ->format($number, $currency_sign);
    $this
      ->assertSame($result, $result_expected, 'BartFeenstra\\CLDR\\CurrencyFormatter::format() formats amount ' . $number . ' as ' . $result_expected . ' using pattern ' . $formatter->pattern . ' (result was ' . $result . ').');
  }

}

Members