From 36c1ed83107d3e0cd9e458095a80cf71961146b3 Mon Sep 17 00:00:00 2001 From: Regis Freyd Date: Sun, 21 Jan 2018 22:49:35 -0500 Subject: [PATCH] Add more unit test coverage for money helper --- tests/Helper/MoneyHelperTest.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/Helper/MoneyHelperTest.php b/tests/Helper/MoneyHelperTest.php index 73fae9a60b8..07c07f7f697 100644 --- a/tests/Helper/MoneyHelperTest.php +++ b/tests/Helper/MoneyHelperTest.php @@ -40,4 +40,16 @@ public function testFormatReturnsZeroIfAmountIsNull() { $this->assertEquals('0', MoneyHelper::format(null)); } + + public function test_it_covers_brazilian_currency() + { + $currency = Currency::where('iso', 'BRL')->first(); + + $user = factory(User::class)->create([ + 'currency_id' => $currency->id, + ]); + $this->actingAs($user); + + $this->assertEquals('R$12.345,67', MoneyHelper::format(12345.67)); + } }