Code Duplication    Length = 20-20 lines in 3 locations

Tests/Command/SmokeTestRunCommandTest.php 3 locations

@@ 62-81 (lines=20) @@
59
        $this->commandConfiguration = null;
60
    }
61
62
    public function testSmokeTestCommandNoLabels()
63
    {
64
        $smokeTestOutput = $this->createMock(SmokeTestOutputInterface::class);
65
        $smokeTestOutput->expects($this->any())->method('isOK')->will($this->returnValue(true));
66
        $smokeTestOutput->expects($this->any())->method('getMessages')->will($this->returnValue([]));
67
68
        $smokeTest1 = $this->createMock(SmokeTestInterface::class);
69
        $smokeTest1->expects($this->never())->method('run')->will($this->returnValue($smokeTestOutput));
70
        $smokeTest1->expects($this->never())->method('getDescription');
71
72
        $smokeTest2 = $this->createMock(SmokeTestInterface::class);
73
        $smokeTest2->expects($this->once())->method('run')->will($this->returnValue($smokeTestOutput));
74
        $smokeTest2->expects($this->once())->method('getDescription');
75
76
        $smokeTestRunCommand = new SmokeTestRunCommand();
77
        $smokeTestRunCommand->addTest('id1', $smokeTest1, 'run', 'getDescription', ['wip']);
78
        $smokeTestRunCommand->addTest('id2', $smokeTest2, 'run', 'getDescription', ['critical']);
79
        
80
        $smokeTestRunCommand->run(new ArrayInput(['--label' => []]), new NullOutput());
81
    }
82
83
    public function testSmokeTestCommandWipLabel()
84
    {
@@ 83-102 (lines=20) @@
80
        $smokeTestRunCommand->run(new ArrayInput(['--label' => []]), new NullOutput());
81
    }
82
83
    public function testSmokeTestCommandWipLabel()
84
    {
85
        $smokeTestOutput = $this->createMock(SmokeTestOutputInterface::class);
86
        $smokeTestOutput->expects($this->any())->method('isOK')->will($this->returnValue(true));
87
        $smokeTestOutput->expects($this->any())->method('getMessages')->will($this->returnValue([]));
88
89
        $smokeTest1 = $this->createMock(SmokeTestInterface::class);
90
        $smokeTest1->expects($this->once())->method('run')->will($this->returnValue($smokeTestOutput));
91
        $smokeTest1->expects($this->once())->method('getDescription');
92
93
        $smokeTest2 = $this->createMock(SmokeTestInterface::class);
94
        $smokeTest2->expects($this->never())->method('run')->will($this->returnValue($smokeTestOutput));
95
        $smokeTest2->expects($this->never())->method('getDescription');
96
97
        $smokeTestRunCommand = new SmokeTestRunCommand();
98
        $smokeTestRunCommand->addTest('id1', $smokeTest1, 'run', 'getDescription', ['wip']);
99
        $smokeTestRunCommand->addTest('id2', $smokeTest2, 'run', 'getDescription', ['critical']);
100
101
        $smokeTestRunCommand->run(new ArrayInput(['--label' => ['wip']]), new NullOutput());
102
    }
103
104
    public function testSmokeTestCommandAllTests()
105
    {
@@ 104-123 (lines=20) @@
101
        $smokeTestRunCommand->run(new ArrayInput(['--label' => ['wip']]), new NullOutput());
102
    }
103
104
    public function testSmokeTestCommandAllTests()
105
    {
106
        $smokeTestOutput = $this->createMock(SmokeTestOutputInterface::class);
107
        $smokeTestOutput->expects($this->any())->method('isOK')->will($this->returnValue(true));
108
        $smokeTestOutput->expects($this->any())->method('getMessages')->will($this->returnValue([]));
109
110
        $smokeTest1 = $this->createMock(SmokeTestInterface::class);
111
        $smokeTest1->expects($this->once())->method('run')->will($this->returnValue($smokeTestOutput));
112
        $smokeTest1->expects($this->once())->method('getDescription');
113
114
        $smokeTest2 = $this->createMock(SmokeTestInterface::class);
115
        $smokeTest2->expects($this->once())->method('run')->will($this->returnValue($smokeTestOutput));
116
        $smokeTest2->expects($this->once())->method('getDescription');
117
118
        $smokeTestRunCommand = new SmokeTestRunCommand();
119
        $smokeTestRunCommand->addTest('id1', $smokeTest1, 'run', 'getDescription', ['wip']);
120
        $smokeTestRunCommand->addTest('id2', $smokeTest2, 'run', 'getDescription', ['critical']);
121
122
        $smokeTestRunCommand->run(new ArrayInput(['--all' => true]), new NullOutput());
123
    }
124
125
    public function testExecute()
126
    {