Passed
Pull Request — master (#4)
by Ayan
05:45
created

ErrorTest   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 3
dl 0
loc 29
rs 10
c 0
b 0
f 0
1
<?php namespace Phprest\Entity;
2
3
use Phprest\Exception\Exception;
4
use PHPUnit\Framework\TestCase;
5
6
class ErrorTest extends TestCase
7
{
8
    /**
9
     * @var Error
10
     */
11
    protected $error;
12
13
    public function setUp()
14
    {
15
        $this->error = new Error(new \Exception('exception message', 101));
16
    }
17
18
    public function testGetCode(): void
19
    {
20
        $this->assertEquals(101, $this->error->getCode());
21
    }
22
23
    public function testGetMessage(): void
24
    {
25
        $this->assertEquals('exception message', $this->error->getMessage());
26
    }
27
28
    public function testGetDetails(): void
29
    {
30
        $error = new Error(new Exception('', 0, 500, ['details']));
31
32
        $this->assertEquals(['details'], $error->getDetails());
33
    }
34
}
35