Completed
Push — master ( b9f967...7a222d )
by Andreu
9s
created

InfiniteDecimalLog10Test   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 2
c 1
b 0
f 1
lcom 0
cbo 3
dl 0
loc 18
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testNegativeInfiniteLog10() 0 4 1
A testPInfiniteLog10() 0 6 1
1
<?php
2
3
use Litipk\BigNumbers\InfiniteDecimal as InfiniteDecimal;
4
5
6
date_default_timezone_set('UTC');
7
8
9
class InfiniteDecimalLog10Test extends PHPUnit_Framework_TestCase
10
{
11
    /**
12
     * @expectedException \DomainException
13
     * @expectedExceptionMessage Decimal can't handle logarithms of negative numbers (it's only for real numbers).
14
     */
15
    public function testNegativeInfiniteLog10()
16
    {
17
        InfiniteDecimal::getNegativeInfinite()->log10();
18
    }
19
20
    public function testPInfiniteLog10()
21
    {
22
        $pInf = InfiniteDecimal::getPositiveInfinite();
23
24
        $this->assertTrue($pInf->log10()->equals($pInf));
25
    }
26
}
27