1 | <?php |
||
2 | /** |
||
3 | * Currency Test |
||
4 | * |
||
5 | * @author Pronamic <[email protected]> |
||
6 | * @copyright 2005-2021 Pronamic |
||
7 | * @license GPL-3.0-or-later |
||
8 | * @package Pronamic\WordPress\Money |
||
9 | */ |
||
10 | |||
11 | namespace Pronamic\WordPress\Money; |
||
12 | |||
13 | use WP_Locale; |
||
14 | use WP_UnitTestCase; |
||
15 | |||
16 | /** |
||
17 | * Currency Test |
||
18 | * |
||
19 | * @author Remco Tolsma |
||
20 | * @version 1.2.2 |
||
21 | * @since 1.0.0 |
||
22 | */ |
||
23 | class CurrencyTest extends WP_UnitTestCase { |
||
24 | /** |
||
25 | * Test Euro. |
||
26 | */ |
||
27 | public function test_euro() { |
||
28 | $currency = Currencies::get_currency( 'EUR' ); |
||
29 | |||
30 | $this->assertSame( '978', $currency->get_numeric_code() ); |
||
31 | $this->assertSame( 'Euro', $currency->get_name() ); |
||
32 | $this->assertJsonStringEqualsJsonString( '"EUR"', \wp_json_encode( $currency ) ); |
||
0 ignored issues
–
show
Bug
introduced
by
![]() |
|||
33 | } |
||
34 | |||
35 | /** |
||
36 | * Test invalid alphabetic code. |
||
37 | */ |
||
38 | public function test_invalid_alphabetic_code() { |
||
39 | $alphabetic_code = 'ABCDEF'; |
||
40 | |||
41 | $this->expectException( \InvalidArgumentException::class ); |
||
42 | |||
43 | $currency = new Currency( 'ABCDEF' ); |
||
44 | } |
||
45 | } |
||
46 |