File tree 2 files changed +16
-4
lines changed
2 files changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -237,6 +237,7 @@ private function getRatesFromCBAR()
237
237
$ this ->rates [$ this ->date ][(string ) $ currency ->attributes ()['Code ' ]] = [
238
238
'rate ' => (float ) $ currency ->Value ,
239
239
'nominal ' => (int ) $ currency ->Nominal ,
240
+ 'name ' => (string ) $ currency ->Name ,
240
241
];
241
242
}
242
243
}
Original file line number Diff line number Diff line change @@ -85,7 +85,8 @@ public function test_magic_get_method_returns_currency_rate()
85
85
'01.05.2019 ' => [
86
86
'USD ' => [
87
87
'nominal ' => 1 ,
88
- 'rate ' => 1.7053 ,
88
+ 'name ' => '1 ABŞ dolları ' ,
89
+ 'rate ' => 1.7053 ,
89
90
],
90
91
],
91
92
]);
@@ -102,7 +103,8 @@ public function test_magic_get_method_throws_exception_if_currency_is_not_availa
102
103
'01.05.2019 ' => [
103
104
'USD ' => [
104
105
'nominal ' => 1 ,
105
- 'rate ' => 1.7053 ,
106
+ 'name ' => '1 ABŞ dolları ' ,
107
+ 'rate ' => 1.7053 ,
106
108
],
107
109
],
108
110
]);
@@ -147,7 +149,8 @@ public function test_magic_set_method_throws_exception_if_currency_is_not_availa
147
149
'01.05.2019 ' => [
148
150
'USD ' => [
149
151
'nominal ' => 1 ,
150
- 'rate ' => 1.7053 ,
152
+ 'name ' => '1 ABŞ dolları ' ,
153
+ 'rate ' => 1.7053 ,
151
154
],
152
155
],
153
156
]);
@@ -175,12 +178,20 @@ public function test_azn_method_returns_azn_to_other_currency_conversion_with_gi
175
178
'01.05.2019 ' => [
176
179
'EUR ' => [
177
180
'nominal ' => 1 ,
178
- 'rate ' => 2 ,
181
+ 'name ' => '1 ABŞ dolları ' ,
182
+ 'rate ' => 2 ,
179
183
],
180
184
],
181
185
]);
182
186
183
187
$ this ->assertEquals (0.5 , $ cbar ->AZN ()->EUR );
184
188
$ this ->assertEquals (5 , $ cbar ->AZN (10 )->EUR );
185
189
}
190
+
191
+ public function test_method_returns_name_in_body ()
192
+ {
193
+ $ cbar = new CBAR ();
194
+ $ rates = $ cbar ->for ('01.05.2019 ' )->getRates ()['01.05.2019 ' ];
195
+ $ this ->assertEquals ("1 ABŞ dolları " , $ rates ["USD " ]["name " ]);
196
+ }
186
197
}
You can’t perform that action at this time.
0 commit comments