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.

BigIntegerSetValueTest   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 72
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

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

5 Methods

Rating   Name   Duplication   Size   Complexity  
A testWithInteger() 0 12 1
A testWithString() 0 12 1
A testWithBigInteger() 0 13 1
A testWithMutableFalse() 0 11 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 BigIntegerSetValueTest extends PHPUnit_Framework_TestCase
9
{
10
    public function testWithInteger()
11
    {
12
        // Arrange
13
        $bigInteger = new BigInteger('0');
14
15
        // Act
16
        $bigInteger->setValue(123);
17
18
        // Assert
19
        $this->assertInternalType('string', $bigInteger->getValue());
20
        $this->assertEquals('123', $bigInteger->getValue());
21
    }
22
23
    public function testWithString()
24
    {
25
        // Arrange
26
        $bigInteger = new BigInteger('0');
27
28
        // Act
29
        $bigInteger->setValue('123');
30
31
        // Assert
32
        $this->assertInternalType('string', $bigInteger->getValue());
33
        $this->assertEquals('123', $bigInteger->getValue());
34
    }
35
36
    public function testWithBigInteger()
37
    {
38
        // Arrange
39
        $bigInteger = new BigInteger('0');
40
        $bigIntegerValue = new BigInteger('123');
41
42
        // Act
43
        $bigInteger->setValue($bigIntegerValue);
44
45
        // Assert
46
        $this->assertInternalType('string', $bigInteger->getValue());
47
        $this->assertEquals('123', $bigInteger->getValue());
48
    }
49
50
    /**
51
     * @expectedException RuntimeException
52
     */
53
    public function testWithMutableFalse()
54
    {
55
        // Arrange
56
        $bigInteger = new BigInteger('0', false);
57
58
        // Act
59
        $bigInteger->setValue('123');
60
61
        // Assert
62
        // ...
63
    }
64
65
    public function testWithMutableTrue()
66
    {
67
        // Arrange
68
        $bigInteger = new BigInteger('0', true);
69
70
        // Act
71
        $newBigInteger = $bigInteger->setValue('123');
72
73
        // Assert
74
        $this->assertInstanceOf('PHP\Math\BigInteger\BigInteger', $bigInteger);
75
        $this->assertInstanceOf('PHP\Math\BigInteger\BigInteger', $newBigInteger);
76
        $this->assertEquals('123', $bigInteger->getValue());
77
        $this->assertEquals('123', $newBigInteger->getValue());
78
    }
79
}
80