Code Duplication    Length = 11-12 lines in 3 locations

tests/Xigen/Console/CheckTest.php 2 locations

@@ 30-41 (lines=12) @@
27
        });
28
    }
29
30
    public function testNoCSR()
31
    {
32
        $command = new Check();
33
        $tester = new CommandTester($command);
34
35
        try {
36
            $tester->execute([]);
37
        } catch (\Exception $e) {
38
            $this->assertEmpty($tester->getDisplay(), "Message wan't empty");
39
            $this->assertSame($e->getMessage(), 'Not enough arguments (missing: "csr").');
40
        }
41
    }
42
43
    public function testWithInvalidCSR()
44
    {
@@ 75-85 (lines=11) @@
72
        $this->assertRegExp('/Error!/', $tester->getDisplay());
73
    }
74
75
    public function testWithCorrectCSR()
76
    {
77
        $command = new Check();
78
        $tester = new CommandTester($command);
79
        $tester->execute([
80
            'csr' => 'certificate/test.csr'
81
        ]);
82
83
        $this->assertSame($tester->getStatusCode(), (int) 0);
84
        $this->assertRegExp('/Success!/', $tester->getDisplay());
85
    }
86
}
87

tests/Xigen/Console/CreateFileTest.php 1 location

@@ 30-41 (lines=12) @@
27
        });
28
    }
29
30
    public function testNoCSR()
31
    {
32
        $command = new CreateFile();
33
        $tester = new CommandTester($command);
34
35
        try {
36
            $tester->execute([]);
37
        } catch (\Exception $e) {
38
            $this->assertEmpty($tester->getDisplay(), "Message wan't empty");
39
            $this->assertSame($e->getMessage(), 'Not enough arguments (missing: "csr").');
40
        }
41
    }
42
43
    public function testWithBadCSR()
44
    {