CurrencyTraitTest::dataMoneyHTMLFormat()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 5
c 0
b 0
f 0
dl 0
loc 7
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
namespace ByTIC\Payments\Tests\Models\Currencies\Traits;
4
5
use Paytic\Payments\Tests\AbstractTest;
6
use Paytic\Payments\Tests\Fixtures\Records\Currencies\Currency;
7
8
/**
9
 * Class CurrencyTraitTest
10
 * @package ByTIC\Payments\Tests\Models\Currencies\Traits
11
 */
12
class CurrencyTraitTest extends AbstractTest
13
{
14
    /**
15
     * @param $amount
16
     * @dataProvider dataMoneyHTMLFormat
17
     */
18
    public function testMoneyHTMLFormat($amount, $htmlExpected)
19
    {
20
        $currency = new Currency();
21
        $currency->code = 'RON';
22
        $currency->symbol = 'lei';
23
24
        self::assertSame($htmlExpected, $currency->moneyHTMLFormat($amount));
25
    }
26
27
    /**
28
     * @return array
29
     */
30
    public function dataMoneyHTMLFormat()
31
    {
32
        return [
33
            ['200.789','<span class="price" content="200.789"><span class="money-int">200</span><sup class="money-decimal">.79</sup> <span class="money-currency">lei</span></span>'],
34
            ['200.749','<span class="price" content="200.749"><span class="money-int">200</span><sup class="money-decimal">.75</sup> <span class="money-currency">lei</span></span>'],
35
            ['200.744','<span class="price" content="200.744"><span class="money-int">200</span><sup class="money-decimal">.74</sup> <span class="money-currency">lei</span></span>'],
36
            ['200','<span class="price" content="200"><span class="money-int">200</span><sup class="money-decimal">.00</sup> <span class="money-currency">lei</span></span>'],
37
        ];
38
    }
39
}
40