|
@@ 75-96 (lines=22) @@
|
| 72 |
|
parent::tearDown(); // TODO: Change the autogenerated stub |
| 73 |
|
} |
| 74 |
|
|
| 75 |
|
public function testSmokeTestCommandNoLabels() |
| 76 |
|
{ |
| 77 |
|
$smokeTestInput = $this->createMock(InputInterface::class); |
| 78 |
|
|
| 79 |
|
$smokeTestOutput = $this->createMock(SmokeTestOutputInterface::class); |
| 80 |
|
$smokeTestOutput->expects($this->any())->method('isOK')->will($this->returnValue(true)); |
| 81 |
|
$smokeTestOutput->expects($this->any())->method('getMessages')->will($this->returnValue([])); |
| 82 |
|
|
| 83 |
|
$smokeTest1 = $this->createMock(SmokeTestInterface::class); |
| 84 |
|
$smokeTest1->expects($this->never())->method('run')->will($this->returnValue($smokeTestOutput)); |
| 85 |
|
$smokeTest1->expects($this->never())->method('getDescription'); |
| 86 |
|
|
| 87 |
|
$smokeTest2 = $this->createMock(SmokeTestInterface::class); |
| 88 |
|
$smokeTest2->expects($this->once())->method('run')->will($this->returnValue($smokeTestOutput)); |
| 89 |
|
$smokeTest2->expects($this->once())->method('getDescription'); |
| 90 |
|
|
| 91 |
|
$smokeTestRunCommand = new SmokeTestRunCommand(); |
| 92 |
|
$smokeTestRunCommand->addTest('id1', $smokeTest1, 'run', 'getDescription', ['wip']); |
| 93 |
|
$smokeTestRunCommand->addTest('id2', $smokeTest2, 'run', 'getDescription', ['critical']); |
| 94 |
|
|
| 95 |
|
$smokeTestRunCommand->run(new ArrayInput(['--label' => []]), new NullOutput()); |
| 96 |
|
} |
| 97 |
|
|
| 98 |
|
public function testMockSmokeTestCommandWipLabel() |
| 99 |
|
{ |
|
@@ 98-119 (lines=22) @@
|
| 95 |
|
$smokeTestRunCommand->run(new ArrayInput(['--label' => []]), new NullOutput()); |
| 96 |
|
} |
| 97 |
|
|
| 98 |
|
public function testMockSmokeTestCommandWipLabel() |
| 99 |
|
{ |
| 100 |
|
$smokeTestInput = $this->createMock(InputInterface::class); |
| 101 |
|
|
| 102 |
|
$smokeTestOutput = $this->createMock(SmokeTestOutputInterface::class); |
| 103 |
|
$smokeTestOutput->expects($this->any())->method('isOK')->will($this->returnValue(true)); |
| 104 |
|
$smokeTestOutput->expects($this->any())->method('getMessages')->will($this->returnValue([])); |
| 105 |
|
|
| 106 |
|
$smokeTest1 = $this->createMock(SmokeTestInterface::class); |
| 107 |
|
$smokeTest1->expects($this->once())->method('run')->will($this->returnValue($smokeTestOutput)); |
| 108 |
|
$smokeTest1->expects($this->once())->method('getDescription'); |
| 109 |
|
|
| 110 |
|
$smokeTest2 = $this->createMock(SmokeTestInterface::class); |
| 111 |
|
$smokeTest2->expects($this->never())->method('run')->will($this->returnValue($smokeTestOutput)); |
| 112 |
|
$smokeTest2->expects($this->never())->method('getDescription'); |
| 113 |
|
|
| 114 |
|
$smokeTestRunCommand = new SmokeTestRunCommand(); |
| 115 |
|
$smokeTestRunCommand->addTest('id1', $smokeTest1, 'run', 'getDescription', ['wip']); |
| 116 |
|
$smokeTestRunCommand->addTest('id2', $smokeTest2, 'run', 'getDescription', ['critical']); |
| 117 |
|
|
| 118 |
|
$smokeTestRunCommand->run(new ArrayInput(['--label' => ['wip']]), new NullOutput()); |
| 119 |
|
} |
| 120 |
|
|
| 121 |
|
public function testMockSmokeTestCommandAllTests() |
| 122 |
|
{ |
|
@@ 121-142 (lines=22) @@
|
| 118 |
|
$smokeTestRunCommand->run(new ArrayInput(['--label' => ['wip']]), new NullOutput()); |
| 119 |
|
} |
| 120 |
|
|
| 121 |
|
public function testMockSmokeTestCommandAllTests() |
| 122 |
|
{ |
| 123 |
|
$smokeTestInput = $this->createMock(InputInterface::class); |
| 124 |
|
|
| 125 |
|
$smokeTestOutput = $this->createMock(SmokeTestOutputInterface::class); |
| 126 |
|
$smokeTestOutput->expects($this->any())->method('isOK')->will($this->returnValue(true)); |
| 127 |
|
$smokeTestOutput->expects($this->any())->method('getMessages')->will($this->returnValue([])); |
| 128 |
|
|
| 129 |
|
$smokeTest1 = $this->createMock(SmokeTestInterface::class); |
| 130 |
|
$smokeTest1->expects($this->once())->method('run')->will($this->returnValue($smokeTestOutput)); |
| 131 |
|
$smokeTest1->expects($this->once())->method('getDescription'); |
| 132 |
|
|
| 133 |
|
$smokeTest2 = $this->createMock(SmokeTestInterface::class); |
| 134 |
|
$smokeTest2->expects($this->once())->method('run')->will($this->returnValue($smokeTestOutput)); |
| 135 |
|
$smokeTest2->expects($this->once())->method('getDescription'); |
| 136 |
|
|
| 137 |
|
$smokeTestRunCommand = new SmokeTestRunCommand(); |
| 138 |
|
$smokeTestRunCommand->addTest('id1', $smokeTest1, 'run', 'getDescription', ['wip']); |
| 139 |
|
$smokeTestRunCommand->addTest('id2', $smokeTest2, 'run', 'getDescription', ['critical']); |
| 140 |
|
|
| 141 |
|
$smokeTestRunCommand->run(new ArrayInput(['--all' => true]), new NullOutput()); |
| 142 |
|
} |
| 143 |
|
|
| 144 |
|
private function setCommandConfiguration($options = []) |
| 145 |
|
{ |