Completed
Push — master ( 1c72b8...2bd393 )
by ophelie
03:53
created

ComposeFileTest::testCreateCompseFileFailed()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 3
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace DockerCompose\Tests;
4
5
use PHPUnit_Framework_TestCase;
6
use DockerCompose\ComposeFile;
7
8
9
class ComposeFileTest extends PHPUnit_Framework_TestCase
10
{
11
    /**
12
     * Test create file success
13
     */
14
    public function testCreateCompseFileSuccess() {
15
        $file = new ComposeFile('docker-compose.yml');
0 ignored issues
show
Unused Code introduced by
$file 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...
16
    }
17
18
    /**
19
     * Test create file failed
20
     *
21
     * @expectedException Exception
22
     */
23
    public function testCreateCompseFileFailed() {
24
        $file = new ComposeFile(25);
0 ignored issues
show
Unused Code introduced by
$file 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...
25
    }
26
}
27