Conditions | 1 |
Paths | 1 |
Total Lines | 32 |
Code Lines | 20 |
Lines | 0 |
Ratio | 0 % |
1 | <?php |
||
107 | public function testDeploymentFailure() { |
||
108 | $step = $this->getDummyDeployment(); |
||
109 | $step->start(); |
||
110 | |||
111 | // Assert not error at startup |
||
112 | $this->assertEquals('Started', $step->Status); |
||
1 ignored issue
–
show
|
|||
113 | $this->assertEquals('Snapshot', $step->Doing); |
||
1 ignored issue
–
show
|
|||
114 | $this->assertTrue(PipelineTest_MockLog::has_message('TestDeployStep:Snapshot creating snapshot of database')); |
||
1 ignored issue
–
show
|
|||
115 | |||
116 | // Mark the snapshot as completed and check result |
||
117 | $snapshot = $step->Pipeline()->PreviousSnapshot(); |
||
118 | $snapshot->markFinished(); |
||
119 | |||
120 | // Retry step |
||
121 | PipelineTest_MockLog::clear(); |
||
122 | $step->start(); |
||
123 | |||
124 | $this->assertEquals('Started', $step->Status); |
||
1 ignored issue
–
show
|
|||
125 | $this->assertEquals('Deployment', $step->Doing); |
||
1 ignored issue
–
show
|
|||
126 | $this->assertTrue(PipelineTest_MockLog::has_message('TestDeployStep:Deployment starting deployment')); |
||
1 ignored issue
–
show
|
|||
127 | |||
128 | // Mark the service as completed and check result |
||
129 | $deployment = $step->Pipeline()->CurrentDeployment(); |
||
130 | $deployment->markFailed(); |
||
131 | |||
132 | // Retry step |
||
133 | PipelineTest_MockLog::clear(); |
||
134 | $step->start(); |
||
135 | $this->assertEquals('Failed', $step->Status); |
||
1 ignored issue
–
show
|
|||
136 | $this->assertTrue(PipelineTest_MockLog::has_message('Checking status of TestDeployStep:Deployment...')); |
||
1 ignored issue
–
show
|
|||
137 | $this->assertTrue(PipelineTest_MockLog::has_message('TestDeployStep:Deployment failed with task status Failed')); |
||
1 ignored issue
–
show
|
|||
138 | } |
||
139 | |||
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.