diff options
Diffstat (limited to 'vendor/symfony/intl/Symfony/Component/Intl/Tests/ResourceBundle/CurrencyBundleTest.php')
-rw-r--r-- | vendor/symfony/intl/Symfony/Component/Intl/Tests/ResourceBundle/CurrencyBundleTest.php | 98 |
1 files changed, 0 insertions, 98 deletions
diff --git a/vendor/symfony/intl/Symfony/Component/Intl/Tests/ResourceBundle/CurrencyBundleTest.php b/vendor/symfony/intl/Symfony/Component/Intl/Tests/ResourceBundle/CurrencyBundleTest.php deleted file mode 100644 index b66a6727..00000000 --- a/vendor/symfony/intl/Symfony/Component/Intl/Tests/ResourceBundle/CurrencyBundleTest.php +++ /dev/null | |||
@@ -1,98 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of the Symfony package. | ||
5 | * | ||
6 | * (c) Fabien Potencier <fabien@symfony.com> | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | namespace Symfony\Component\Intl\Tests\ResourceBundle; | ||
13 | |||
14 | use Symfony\Component\Intl\ResourceBundle\CurrencyBundle; | ||
15 | |||
16 | /** | ||
17 | * @author Bernhard Schussek <bschussek@gmail.com> | ||
18 | */ | ||
19 | class CurrencyBundleTest extends \PHPUnit_Framework_TestCase | ||
20 | { | ||
21 | const RES_DIR = '/base/curr'; | ||
22 | |||
23 | /** | ||
24 | * @var CurrencyBundle | ||
25 | */ | ||
26 | private $bundle; | ||
27 | |||
28 | /** | ||
29 | * @var \PHPUnit_Framework_MockObject_MockObject | ||
30 | */ | ||
31 | private $reader; | ||
32 | |||
33 | protected function setUp() | ||
34 | { | ||
35 | $this->reader = $this->getMock('Symfony\Component\Intl\ResourceBundle\Reader\StructuredBundleReaderInterface'); | ||
36 | $this->bundle = new CurrencyBundle(self::RES_DIR, $this->reader); | ||
37 | } | ||
38 | |||
39 | public function testGetCurrencySymbol() | ||
40 | { | ||
41 | $this->reader->expects($this->once()) | ||
42 | ->method('readEntry') | ||
43 | ->with(self::RES_DIR, 'en', array('Currencies', 'EUR', 1)) | ||
44 | ->will($this->returnValue('€')); | ||
45 | |||
46 | $this->assertSame('€', $this->bundle->getCurrencySymbol('EUR', 'en')); | ||
47 | } | ||
48 | |||
49 | public function testGetCurrencyName() | ||
50 | { | ||
51 | $this->reader->expects($this->once()) | ||
52 | ->method('readEntry') | ||
53 | ->with(self::RES_DIR, 'en', array('Currencies', 'EUR', 0)) | ||
54 | ->will($this->returnValue('Euro')); | ||
55 | |||
56 | $this->assertSame('Euro', $this->bundle->getCurrencyName('EUR', 'en')); | ||
57 | } | ||
58 | |||
59 | public function testGetCurrencyNames() | ||
60 | { | ||
61 | $sortedCurrencies = array( | ||
62 | 'USD' => array(0 => 'Dollar'), | ||
63 | 'EUR' => array(0 => 'Euro'), | ||
64 | ); | ||
65 | |||
66 | $this->reader->expects($this->once()) | ||
67 | ->method('readEntry') | ||
68 | ->with(self::RES_DIR, 'en', array('Currencies')) | ||
69 | ->will($this->returnValue($sortedCurrencies)); | ||
70 | |||
71 | $sortedNames = array( | ||
72 | 'USD' => 'Dollar', | ||
73 | 'EUR' => 'Euro', | ||
74 | ); | ||
75 | |||
76 | $this->assertSame($sortedNames, $this->bundle->getCurrencyNames('en')); | ||
77 | } | ||
78 | |||
79 | public function testGetFractionDigits() | ||
80 | { | ||
81 | $this->reader->expects($this->once()) | ||
82 | ->method('readEntry') | ||
83 | ->with(self::RES_DIR, 'en', array('Currencies', 'EUR', 2)) | ||
84 | ->will($this->returnValue(123)); | ||
85 | |||
86 | $this->assertSame(123, $this->bundle->getFractionDigits('EUR')); | ||
87 | } | ||
88 | |||
89 | public function testGetRoundingIncrement() | ||
90 | { | ||
91 | $this->reader->expects($this->once()) | ||
92 | ->method('readEntry') | ||
93 | ->with(self::RES_DIR, 'en', array('Currencies', 'EUR', 3)) | ||
94 | ->will($this->returnValue(123)); | ||
95 | |||
96 | $this->assertSame(123, $this->bundle->getRoundingIncrement('EUR')); | ||
97 | } | ||
98 | } | ||