| Conditions | 1 |
| Paths | 1 |
| Total Lines | 47 |
| Code Lines | 32 |
| Lines | 0 |
| Ratio | 0 % |
| 1 | <?php |
||
| 140 | public function testDelayedSuccess() { |
||
| 141 | $step = $this->getDummyDeployment(); |
||
| 142 | $step->start(); |
||
| 143 | |||
| 144 | // Assert not error at startup |
||
| 145 | $this->assertEquals('Started', $step->Status); |
||
|
1 ignored issue
–
show
|
|||
| 146 | $this->assertEquals('Snapshot', $step->Doing); |
||
|
1 ignored issue
–
show
|
|||
| 147 | $this->assertTrue(PipelineTest_MockLog::has_message('TestDeployStep:Snapshot creating snapshot of database')); |
||
|
1 ignored issue
–
show
|
|||
| 148 | |||
| 149 | // Retry step |
||
| 150 | PipelineTest_MockLog::clear(); |
||
| 151 | $step->start(); |
||
| 152 | $this->assertEquals('Started', $step->Status); |
||
|
1 ignored issue
–
show
|
|||
| 153 | $this->assertEquals('Snapshot', $step->Doing); |
||
|
1 ignored issue
–
show
|
|||
| 154 | $this->assertTrue(PipelineTest_MockLog::has_message('Checking status of TestDeployStep:Snapshot...')); |
||
|
1 ignored issue
–
show
|
|||
| 155 | $this->assertTrue(PipelineTest_MockLog::has_message('TestDeployStep:Snapshot is still in progress')); |
||
|
1 ignored issue
–
show
|
|||
| 156 | |||
| 157 | // Mark the snapshot as completed and check result |
||
| 158 | $snapshot = $step->Pipeline()->PreviousSnapshot(); |
||
| 159 | $snapshot->markFinished(); |
||
| 160 | |||
| 161 | // Advance to deployment |
||
| 162 | PipelineTest_MockLog::clear(); |
||
| 163 | $step->start(); |
||
| 164 | $this->assertEquals('Started', $step->Status); |
||
|
1 ignored issue
–
show
|
|||
| 165 | $this->assertEquals('Deployment', $step->Doing); |
||
|
1 ignored issue
–
show
|
|||
| 166 | $this->assertTrue(PipelineTest_MockLog::has_message('TestDeployStep:Deployment starting deployment')); |
||
|
1 ignored issue
–
show
|
|||
| 167 | |||
| 168 | // Retry step |
||
| 169 | PipelineTest_MockLog::clear(); |
||
| 170 | $step->start(); |
||
| 171 | $this->assertEquals('Started', $step->Status); |
||
|
1 ignored issue
–
show
|
|||
| 172 | $this->assertEquals('Deployment', $step->Doing); |
||
|
1 ignored issue
–
show
|
|||
| 173 | $this->assertTrue(PipelineTest_MockLog::has_message('Checking status of TestDeployStep:Deployment...')); |
||
|
1 ignored issue
–
show
|
|||
| 174 | $this->assertTrue(PipelineTest_MockLog::has_message('TestDeployStep:Deployment is still in progress')); |
||
|
1 ignored issue
–
show
|
|||
| 175 | |||
| 176 | // Mark the service as completed and check result |
||
| 177 | $deployment = $step->Pipeline()->CurrentDeployment(); |
||
| 178 | $deployment->markFinished(); |
||
| 179 | |||
| 180 | // Retry step |
||
| 181 | PipelineTest_MockLog::clear(); |
||
| 182 | $step->start(); |
||
| 183 | $this->assertEquals('Finished', $step->Status); |
||
|
1 ignored issue
–
show
|
|||
| 184 | $this->assertTrue(PipelineTest_MockLog::has_message('Checking status of TestDeployStep:Deployment...')); |
||
|
1 ignored issue
–
show
|
|||
| 185 | $this->assertTrue(PipelineTest_MockLog::has_message('Step finished successfully!')); |
||
|
1 ignored issue
–
show
|
|||
| 186 | } |
||
| 187 | |||
| 210 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.