Completed
Pull Request — master (#75)
by
unknown
01:40
created

DecimalJsonSerialize::testJsonSerializable()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
use Litipk\BigNumbers\Decimal as Decimal;
4
use PHPUnit\Framework\TestCase;
5
6
class DecimalJsonSerialize extends TestCase
7
{
8
    public function testJsonSerialize()
9
    {
10
        $value = '123.456';
11
        $this->assertEquals($value, Decimal::fromString($value)->jsonSerialize());
12
    }
13
14
    public function testJsonSerializable()
15
    {
16
        $value = '123.456';
17
        $this->assertEquals(json_encode($value), json_encode(Decimal::fromString($value)));
18
    }
19
}
20