Passed
Branch devel (076198)
by Marcin
04:11
created

ApiTest::testConstruct_1()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
/**
3
 * Created by Marcin.
4
 * Date: 03.03.2019
5
 * Time: 17:07
6
 */
7
8
namespace Tests\Tvsat\Api\Xmdb;
9
10
use Mrcnpdlk\Api\Unoconv\Api;
11
use Mrcnpdlk\Api\Unoconv\Config;
12
use Mrcnpdlk\Api\Unoconv\Exception\UnoconvException;
13
use PHPUnit\Framework\TestCase;
14
15
class ApiTest extends TestCase
16
{
17
    /**
18
     * @throws \Mrcnpdlk\Api\Unoconv\Exception
19
     */
20
    public function testConstruct_1(): void
21
    {
22
        $oApi = new Api();
0 ignored issues
show
Unused Code introduced by
$oApi is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
23
        $this->assertTrue(true);
24
    }
25
26
    /**
27
     * @throws \Mrcnpdlk\Api\Unoconv\Exception
28
     */
29
    public function testConstruct_invalid(): void
30
    {
31
        $this->expectException(UnoconvException::class);
32
        $config = new Config([
0 ignored issues
show
Unused Code introduced by
$config is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
33
            'binary' => '/some/binary/file',
34
        ]);
35
        $oApi   = new Api();
36
        $oApi->create('sss.docx', 'sss.pdf');
37
    }
38
}
39