Passed
Push — master ( 37c4b5...b13fcd )
by Razon
01:38
created

ExceptionTest::dataProviderSetUp()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 5
rs 10
1
<?php
2
namespace RazonYang\Yii2\JSend\Tests;
3
4
use PHPUnit\Framework\TestCase;
5
use RazonYang\JSend\Exception;
6
7
class ExceptionTest extends TestCase
8
{
9
    /**
10
     * @dataProvider dataProviderSetUp
11
     */
12
    public function testSetUp($message, $code, $previous = null, $data = null): void
13
    {
14
        $e = new Exception($message, $code, $previous, $data);
15
        $this->assertSame($message, $e->getMessage());
16
        $this->assertSame($code, $e->getCode());
17
        $this->assertSame($previous, $e->getPrevious());
18
        $this->assertSame($data, $e->getData());
19
    }
20
21
    public function dataProviderSetUp(): array
22
    {
23
        return [
24
            ['foo', 0, null, null],
25
            ['bar', 1, new \Exception(), 'fuzz'],
26
        ];
27
    }
28
}
29