Code Duplication    Length = 15-15 lines in 3 locations

tests/Xigen/Console/CheckTest.php 2 locations

@@ 43-57 (lines=15) @@
40
        }
41
    }
42
43
    public function testWithInvalidCSR()
44
    {
45
        $command = new Check();
46
        $tester = new CommandTester($command);
47
48
        //Create an empty
49
        file_put_contents('test.csr', '', FILE_APPEND | LOCK_EX);
50
51
        $tester->execute([
52
            'csr' => 'test.csr'
53
        ]);
54
55
        $this->assertSame($tester->getStatusCode(), (int) 3);
56
        $this->assertRegExp('/Error!/', $tester->getDisplay());
57
    }
58
59
    public function testWithBadCSR()
60
    {
@@ 59-73 (lines=15) @@
56
        $this->assertRegExp('/Error!/', $tester->getDisplay());
57
    }
58
59
    public function testWithBadCSR()
60
    {
61
        $command = new Check();
62
        $tester = new CommandTester($command);
63
64
        //Create an empty
65
        file_put_contents('test.csr', ' ' . $this->createFakeCSR(), FILE_APPEND | LOCK_EX);
66
67
        $tester->execute([
68
            'csr' => 'test.csr'
69
        ]);
70
71
        $this->assertSame($tester->getStatusCode(), (int) 3);
72
        $this->assertRegExp('/Error!/', $tester->getDisplay());
73
    }
74
75
    public function testWithCorrectCSR()
76
    {

tests/Xigen/Console/CreateFileTest.php 1 location

@@ 43-57 (lines=15) @@
40
        }
41
    }
42
43
    public function testWithBadCSR()
44
    {
45
        $command = new CreateFile();
46
        $tester = new CommandTester($command);
47
48
        //Create an empty
49
        file_put_contents('test.csr', '', FILE_APPEND | LOCK_EX);
50
51
        $tester->execute([
52
            'csr' => 'test.csr'
53
        ]);
54
55
        $this->assertSame($tester->getStatusCode(), (int) 3);
56
        $this->assertRegExp('/Error!/', $tester->getDisplay());
57
    }
58
59
    public function testWithCorrectCSR()
60
    {