diff options
author | Christian Vogeley <christian.vogeley@hotmail.de> | 2015-01-11 16:22:59 +0100 |
---|---|---|
committer | Christian Vogeley <christian.vogeley@hotmail.de> | 2015-01-11 16:22:59 +0100 |
commit | f0c7612bcd49d32e408e67ac1829ee891c677f7e (patch) | |
tree | d4cff4aa2d728524b631776ffffee71f42056421 /library/intl/tests/NumberFormat/NumberFormatTest.php | |
parent | 43f143a211c75138d09ceb89acc48ea7d5c31ca9 (diff) | |
parent | 10102ac2ac4d5b02012a9794e23656717ab05556 (diff) | |
download | volse-hubzilla-f0c7612bcd49d32e408e67ac1829ee891c677f7e.tar.gz volse-hubzilla-f0c7612bcd49d32e408e67ac1829ee891c677f7e.tar.bz2 volse-hubzilla-f0c7612bcd49d32e408e67ac1829ee891c677f7e.zip |
Merge remote-tracking branch 'upstream/master'
Conflicts:
doc/html/classRedmatrix_1_1Import_1_1Import-members.html
doc/html/classRedmatrix_1_1Import_1_1Import.js
Diffstat (limited to 'library/intl/tests/NumberFormat/NumberFormatTest.php')
-rw-r--r-- | library/intl/tests/NumberFormat/NumberFormatTest.php | 131 |
1 files changed, 131 insertions, 0 deletions
diff --git a/library/intl/tests/NumberFormat/NumberFormatTest.php b/library/intl/tests/NumberFormat/NumberFormatTest.php new file mode 100644 index 000000000..299dc41cb --- /dev/null +++ b/library/intl/tests/NumberFormat/NumberFormatTest.php @@ -0,0 +1,131 @@ +<?php + +namespace CommerceGuys\Intl\Tests\NumberFormat; + +use CommerceGuys\Intl\NumberFormat\NumberFormat; + +/** + * @coversDefaultClass CommerceGuys\Intl\NumberFormat\NumberFormat + */ +class NumberFormatTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var NumberFormat + */ + protected $numberFormat; + + public function setUp() + { + $this->numberFormat = new NumberFormat(); + } + + /** + * @covers ::getLocale + * @covers ::setLocale + */ + public function testLocale() + { + $this->numberFormat->setLocale('en'); + $this->assertEquals('en', $this->numberFormat->getLocale()); + } + + /** + * @covers ::getNumberingSystem + * @covers ::setNumberingSystem + */ + public function testNumberingSystem() + { + $this->numberFormat->setNumberingSystem('latn'); + $this->assertEquals('latn', $this->numberFormat->getNumberingSystem()); + } + + /** + * @covers ::getDecimalSeparator + * @covers ::setDecimalSeparator + */ + public function testDecimalSeparator() + { + $this->numberFormat->setDecimalSeparator('.'); + $this->assertEquals('.', $this->numberFormat->getDecimalSeparator()); + } + + /** + * @covers ::getGroupingSeparator + * @covers ::setGroupingSeparator + */ + public function testGroupingSeparator() + { + $this->numberFormat->setGroupingSeparator(','); + $this->assertEquals(',', $this->numberFormat->getGroupingSeparator()); + } + + /** + * @covers ::getPlusSign + * @covers ::setPlusSign + */ + public function testPlusSign() + { + $this->numberFormat->setPlusSign('+'); + $this->assertEquals('+', $this->numberFormat->getPlusSign()); + } + + /** + * @covers ::getMinusSign + * @covers ::setMinusSign + */ + public function testMinusSign() + { + $this->numberFormat->setMinusSign('-'); + $this->assertEquals('-', $this->numberFormat->getMinusSign()); + } + + /** + * @covers ::getPercentSign + * @covers ::setPercentSign + */ + public function testPercentSign() + { + $this->numberFormat->setPercentSign('%'); + $this->assertEquals('%', $this->numberFormat->getPercentSign()); + } + + /** + * @covers ::getDecimalPattern + * @covers ::setDecimalPattern + */ + public function testDecimalPattern() + { + $this->numberFormat->setDecimalPattern('#,##0.###'); + $this->assertEquals('#,##0.###', $this->numberFormat->getDecimalPattern()); + } + + /** + * @covers ::getPercentPattern + * @covers ::setPercentPattern + */ + public function testPercentPattern() + { + $this->numberFormat->setPercentPattern('#,##0%'); + $this->assertEquals('#,##0%', $this->numberFormat->getPercentPattern()); + } + + /** + * @covers ::getCurrencyPattern + * @covers ::setCurrencyPattern + */ + public function testCurrencyPattern() + { + $this->numberFormat->setCurrencyPattern('¤#,##0.00'); + $this->assertEquals('¤#,##0.00', $this->numberFormat->getCurrencyPattern()); + } + + /** + * @covers ::getAccountingCurrencyPattern + * @covers ::setAccountingCurrencyPattern + */ + public function testAccountingCurrencyPattern() + { + $this->numberFormat->setAccountingCurrencyPattern('¤#,##0.00;(¤#,##0.00)'); + $this->assertEquals('¤#,##0.00;(¤#,##0.00)', $this->numberFormat->getAccountingCurrencyPattern()); + } +} |