Overview
Comment:Add more test case
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | dev
Files: files | file ages | folders
SHA1: 7fc961ba1563f14343244548a75656aca833543d
User & Date: bohwaz on 2020-11-09 22:41:52
Other Links: branch diff | manifest | tags
Context
2020-11-09
22:42
Fix selected tab in menu check-in: ab2e8446ad user: bohwaz tags: dev, 1.0.0-alpha6
22:41
Add more test case check-in: 7fc961ba15 user: bohwaz tags: dev
22:40
Fix issue with single cents check-in: 447fa418e5 user: bohwaz tags: dev
Changes

Modified tests/unit_tests/02_accounting/money.php from [48f882c475] to [0dbffba1f5].

1
2
3
4
5
6
7
8
9
10
11
12
13





<?php

namespace Garradin;
use KD2\Test;

require INIT;

Test::strictlyEquals(500, Utils::moneyToInteger('5'));
Test::strictlyEquals(442, Utils::moneyToInteger('4,42'));
Test::strictlyEquals(442, Utils::moneyToInteger('4.42'));
Test::strictlyEquals(4, Utils::moneyToInteger('0,04'));
Test::strictlyEquals(30, Utils::moneyToInteger('0,3'));
Test::strictlyEquals(202034, Utils::moneyToInteger('2020,34'));


















>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<?php

namespace Garradin;
use KD2\Test;

require INIT;

Test::strictlyEquals(500, Utils::moneyToInteger('5'));
Test::strictlyEquals(442, Utils::moneyToInteger('4,42'));
Test::strictlyEquals(442, Utils::moneyToInteger('4.42'));
Test::strictlyEquals(4, Utils::moneyToInteger('0,04'));
Test::strictlyEquals(30, Utils::moneyToInteger('0,3'));
Test::strictlyEquals(202034, Utils::moneyToInteger('2020,34'));

Test::strictlyEquals('5,50', Utils::money_format(550));
Test::strictlyEquals('0,05', Utils::money_format(5));
Test::strictlyEquals('0,50', Utils::money_format(50));
Test::strictlyEquals('1 000,50', Utils::money_format(100050));