6
6
use DR \Internationalization \Currency \CurrencyFormatOptions ;
7
7
use DR \Internationalization \Currency \CurrencyFormatterFactory ;
8
8
use InvalidArgumentException ;
9
+ use PHPUnit \Framework \Attributes \CoversClass ;
9
10
use PHPUnit \Framework \TestCase ;
10
11
11
- /**
12
- * @coversDefaultClass \DR\Internationalization\Currency\CurrencyFormatterFactory
13
- * @covers ::__construct
14
- */
12
+ #[CoversClass(CurrencyFormatterFactory::class)]
15
13
class CurrencyFormatterFactoryTest extends TestCase
16
14
{
17
15
private const MINUS = "\xE2\x88\x92" ;
18
16
private const NBSP = "\xC2\xA0" ;
19
17
20
- /**
21
- * @covers ::create
22
- */
23
18
public function testCreateLocaleIsRequired (): void
24
19
{
25
20
$ this ->expectException (InvalidArgumentException::class);
26
21
$ this ->expectExceptionMessage ('unable to format currency without a locale ' );
27
22
(new CurrencyFormatterFactory (new CurrencyFormatOptions ()))->create (new CurrencyFormatOptions ());
28
23
}
29
24
30
- /**
31
- * @covers ::create
32
- * @covers ::applyCurrencyFormatOptions
33
- */
34
25
public function testCreateWithDefaults (): void
35
26
{
36
27
$ defaultOptions = (new CurrencyFormatOptions ())->setLocale ('nl_NL ' );
@@ -50,10 +41,6 @@ public function testCreateWithDefaults(): void
50
41
static ::assertSame ('-2.005,56 ' , $ formatter ->format (-2005.555 ));
51
42
}
52
43
53
- /**
54
- * @covers ::create
55
- * @covers ::applyCurrencyFormatOptions
56
- */
57
44
public function testCreateDefaultCurrencyWithCustomSettings (): void
58
45
{
59
46
$ defaultOptions = (new CurrencyFormatOptions ())->setLocale ('nl_NL ' );
@@ -63,10 +50,6 @@ public function testCreateDefaultCurrencyWithCustomSettings(): void
63
50
static ::assertSame ('-2.005,1235 ' , $ formatter ->format (-2005.123456 ));
64
51
}
65
52
66
- /**
67
- * @covers ::create
68
- * @covers ::applyCurrencyFormatOptions
69
- */
70
53
public function testCreateSwedishCurrencyWithSymbol (): void
71
54
{
72
55
$ defaultOptions = (new CurrencyFormatOptions ())->setLocale ('sv_SE ' );
@@ -78,10 +61,6 @@ public function testCreateSwedishCurrencyWithSymbol(): void
78
61
static ::assertSame (self ::MINUS . '2 ' . self ::NBSP . '005,56 ' . self ::NBSP . 'kr ' , $ formatter ->format (-2005.555 ));
79
62
}
80
63
81
- /**
82
- * @covers ::create
83
- * @covers ::applyCurrencyFormatOptions
84
- */
85
64
public function testCreateSwedishCurrencyWithoutSymbol (): void
86
65
{
87
66
$ defaultOptions = (new CurrencyFormatOptions ())->setLocale ('sv_SE ' )->setCurrencyCode ('SEK ' );
@@ -94,10 +73,6 @@ public function testCreateSwedishCurrencyWithoutSymbol(): void
94
73
static ::assertSame (self ::MINUS . '2 ' . self ::NBSP . '005,56 ' , $ formatter ->format (-2005.555 ));
95
74
}
96
75
97
- /**
98
- * @covers ::create
99
- * @covers ::applyCurrencyFormatOptions
100
- */
101
76
public function testCreateIrishCurrency (): void
102
77
{
103
78
$ defaultOptions = (new CurrencyFormatOptions ())->setLocale ('en_IE ' )->setCurrencyCode ('EUR ' );
@@ -108,10 +83,6 @@ public function testCreateIrishCurrency(): void
108
83
static ::assertSame ("€ " . '2,005.56 ' , $ formatter ->format (2005.555 ));
109
84
}
110
85
111
- /**
112
- * @covers ::create
113
- * @covers ::applyCurrencyFormatOptions
114
- */
115
86
public function testCreateForeignCurrencyWithoutSymbolOrGrouping (): void
116
87
{
117
88
$ defaultOptions = (new CurrencyFormatOptions ())->setLocale ('nl_NL ' )->setCurrencyCode ('SEK ' );
@@ -125,10 +96,6 @@ public function testCreateForeignCurrencyWithoutSymbolOrGrouping(): void
125
96
static ::assertSame ('-2005,56 ' , $ formatter ->format (-2005.555 ));
126
97
}
127
98
128
- /**
129
- * @covers ::create
130
- * @covers ::applyCurrencyFormatOptions
131
- */
132
99
public function testCreateForeignCurrencyWithSymbol (): void
133
100
{
134
101
$ defaultOptions = (new CurrencyFormatOptions ())->setLocale ('nl_NL ' )->setCurrencyCode ('SEK ' );
0 commit comments