GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

BigIntegerCmpTest   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 56
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A testWithNegativeNumber() 0 12 1
A testWithPositiveNumber() 0 12 1
A testWithEqualNumber() 0 12 1
A testWithInvalidValue() 0 11 1
1
<?php
2
3
namespace PHP\Math\BigIntegerTest;
4
5
use PHP\Math\BigInteger\BigInteger;
6
use PHPUnit_Framework_TestCase;
7
8
class BigIntegerCmpTest extends PHPUnit_Framework_TestCase
9
{
10
    public function testWithNegativeNumber()
11
    {
12
        // Arrange
13
        $bigInteger = new BigInteger('123');
14
15
        // Act
16
        $result = $bigInteger->cmp('-123');
17
18
        // Assert
19
        $this->assertInternalType('int', $result);
20
        $this->assertEquals(1, $result);
21
    }
22
23
    public function testWithPositiveNumber()
24
    {
25
        // Arrange
26
        $bigInteger = new BigInteger('123');
27
28
        // Act
29
        $result = $bigInteger->cmp('246');
30
31
        // Assert
32
        $this->assertInternalType('int', $result);
33
        $this->assertEquals(-1, $result);
34
    }
35
36
    public function testWithEqualNumber()
37
    {
38
        // Arrange
39
        $bigInteger = new BigInteger('123');
40
41
        // Act
42
        $result = $bigInteger->cmp('123');
43
44
        // Assert
45
        $this->assertInternalType('int', $result);
46
        $this->assertEquals(0, $result);
47
    }
48
49
    /**
50
     * @expectedException InvalidArgumentException
51
     */
52
    public function testWithInvalidValue()
53
    {
54
        // Arrange
55
        $bigInteger = new BigInteger('123');
56
57
        // Act
58
        $bigInteger->cmp('123.456');
59
60
        // Assert
61
        // ...
62
    }
63
}
64