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.

BigIntegerNegateTest   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 45
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A testNegate() 0 12 1
A testWithMutableFalse() 0 14 1
A testWithMutableTrue() 0 14 1
1
<?php
2
3
namespace PHP\Math\BigIntegerTest;
4
5
use PHP\Math\BigInteger\BigInteger;
6
use PHPUnit_Framework_TestCase;
7
8
class BigIntegerNegateTest extends PHPUnit_Framework_TestCase
9
{
10
    public function testNegate()
11
    {
12
        // Arrange
13
        $bigInteger = new BigInteger('123');
14
15
        // Act
16
        $bigInteger->negate();
17
18
        // Assert
19
        $this->assertInternalType('string', $bigInteger->getValue());
20
        $this->assertEquals('-123', $bigInteger->getValue());
21
    }
22
23
    public function testWithMutableFalse()
24
    {
25
        // Arrange
26
        $bigInteger = new BigInteger('10', false);
27
28
        // Act
29
        $newBigInteger = $bigInteger->negate();
30
31
        // Assert
32
        $this->assertInstanceOf('PHP\Math\BigInteger\BigInteger', $bigInteger);
33
        $this->assertInstanceOf('PHP\Math\BigInteger\BigInteger', $newBigInteger);
34
        $this->assertEquals('10', $bigInteger->getValue());
35
        $this->assertEquals('-10', $newBigInteger->getValue());
36
    }
37
38
    public function testWithMutableTrue()
39
    {
40
        // Arrange
41
        $bigInteger = new BigInteger('10', true);
42
43
        // Act
44
        $newBigInteger = $bigInteger->negate();
45
46
        // Assert
47
        $this->assertInstanceOf('PHP\Math\BigInteger\BigInteger', $bigInteger);
48
        $this->assertInstanceOf('PHP\Math\BigInteger\BigInteger', $newBigInteger);
49
        $this->assertEquals('-10', $bigInteger->getValue());
50
        $this->assertEquals('-10', $newBigInteger->getValue());
51
    }
52
}
53