diff options
author | Mario <mario@mariovavti.com> | 2018-01-09 09:00:20 +0100 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2018-01-09 09:00:20 +0100 |
commit | 4f4d0e416eac87121898b8a27b1afa6065ff17a2 (patch) | |
tree | aae7f2582b2b9c6596dcbf87c06a836434140830 /library/intl/tests/NumberFormat/NumberFormatRepositoryTest.php | |
parent | 22c89b6c660e185d5c5c6362acf23b145d932d15 (diff) | |
parent | 8fde0f01b8472082158b38386046ed606bcfbc49 (diff) | |
download | volse-hubzilla-4f4d0e416eac87121898b8a27b1afa6065ff17a2.tar.gz volse-hubzilla-4f4d0e416eac87121898b8a27b1afa6065ff17a2.tar.bz2 volse-hubzilla-4f4d0e416eac87121898b8a27b1afa6065ff17a2.zip |
Merge branch '3.0RC'3.0
Diffstat (limited to 'library/intl/tests/NumberFormat/NumberFormatRepositoryTest.php')
-rw-r--r-- | library/intl/tests/NumberFormat/NumberFormatRepositoryTest.php | 69 |
1 files changed, 0 insertions, 69 deletions
diff --git a/library/intl/tests/NumberFormat/NumberFormatRepositoryTest.php b/library/intl/tests/NumberFormat/NumberFormatRepositoryTest.php deleted file mode 100644 index 41e45805d..000000000 --- a/library/intl/tests/NumberFormat/NumberFormatRepositoryTest.php +++ /dev/null @@ -1,69 +0,0 @@ -<?php - -namespace CommerceGuys\Intl\Tests\NumberFormat; - -use CommerceGuys\Intl\NumberFormat\NumberFormatRepository; -use org\bovigo\vfs\vfsStream; - -/** - * @coversDefaultClass \CommerceGuys\Intl\NumberFormat\NumberFormatRepository - */ -class NumberFormatRepositoryTest extends \PHPUnit_Framework_TestCase -{ - /** - * English number format definition. - * - * @var array - */ - protected $englishDefinition = array( - 'numbering_system' => 'latn', - 'decimal_pattern' => '#,##0.###', - 'percent_pattern' => '#,##0%', - 'currency_pattern' => '¤#,##0.00', - 'accounting_currency_pattern' => '¤#,##0.00;(¤#,##0.00)', - ); - - /** - * @covers ::__construct - */ - public function testConstructor() - { - // Mock the existence of JSON definitions on the filesystem. - $root = vfsStream::setup('resources'); - vfsStream::newFile('number_format/en.json')->at($root)->setContent(json_encode($this->englishDefinition)); - - // Instantiate the number format repository and confirm that the definition - // path was properly set. - $numberFormatRepository = new NumberFormatRepository('vfs://resources/number_format/'); - $definitionPath = $this->getObjectAttribute($numberFormatRepository, 'definitionPath'); - $this->assertEquals('vfs://resources/number_format/', $definitionPath); - - return $numberFormatRepository; - } - - /** - * @covers ::get - * @covers ::createNumberFormatFromDefinition - * @uses \CommerceGuys\Intl\NumberFormat\NumberFormat - * @uses \CommerceGuys\Intl\LocaleResolverTrait - * @depends testConstructor - */ - public function testGet($numberFormatRepository) - { - $numberFormat = $numberFormatRepository->get('en'); - $this->assertInstanceOf('CommerceGuys\\Intl\\NumberFormat\\NumberFormat', $numberFormat); - $this->assertEquals('en', $numberFormat->getLocale()); - $this->assertEquals('latn', $numberFormat->getNumberingSystem()); - $this->assertEquals('.', $numberFormat->getDecimalSeparator()); - $this->assertEquals(',', $numberFormat->getGroupingSeparator()); - $this->assertEquals('+', $numberFormat->getPlusSign()); - $this->assertEquals('-', $numberFormat->getMinusSign()); - $this->assertEquals('%', $numberFormat->getPercentSign()); - $this->assertEquals('#,##0.###', $numberFormat->getDecimalPattern()); - $this->assertEquals('#,##0%', $numberFormat->getPercentPattern()); - $this->assertEquals('¤#,##0.00', $numberFormat->getCurrencyPattern()); - $this->assertEquals('¤#,##0.00;(¤#,##0.00)', $numberFormat->getAccountingCurrencyPattern()); - - return $numberFormat; - } -} |