| Conditions | 1 |
| Paths | 1 |
| Total Lines | 50 |
| Code Lines | 38 |
| Lines | 0 |
| Ratio | 0 % |
| 1 | <?php |
||
| 8 | public function testCheckPipelineStatus() { |
||
| 9 | $pipeline = $this->objFromFixture('Pipeline', 'Pipe2'); |
||
| 10 | $pipeline->Config = serialize(array()); |
||
| 11 | $pipeline->write(); |
||
| 12 | |||
| 13 | // First step should start. |
||
| 14 | $pipeline->checkPipelineStatus(); |
||
| 15 | |||
| 16 | $this->assertEquals('Running', $pipeline->Status); |
||
|
1 ignored issue
–
show
|
|||
| 17 | $this->assertEquals(true, $pipeline->isRunning()); |
||
|
1 ignored issue
–
show
|
|||
| 18 | $this->assertDOSEquals(array( |
||
| 19 | array('Name'=>'step1', 'Status'=>'Started'), |
||
| 20 | array('Name'=>'step2', 'Status'=>'Queued'), |
||
| 21 | ), $pipeline->Steps()); |
||
| 22 | |||
| 23 | // Try to progress the pipeline second time. Shouldn't move until step is finished. |
||
| 24 | $pipeline->checkPipelineStatus(); |
||
| 25 | $this->assertEquals('Running', $pipeline->Status); |
||
|
1 ignored issue
–
show
|
|||
| 26 | $this->assertEquals(true, $pipeline->isRunning()); |
||
|
1 ignored issue
–
show
|
|||
| 27 | $this->assertDOSEquals(array( |
||
| 28 | array('Name'=>'step1', 'Status'=>'Started'), |
||
| 29 | array('Name'=>'step2', 'Status'=>'Queued'), |
||
| 30 | ), $pipeline->Steps()); |
||
| 31 | |||
| 32 | // First step finished, pipeline should move now. |
||
| 33 | $firstStep = $pipeline->CurrentStep(); |
||
| 34 | $firstStep->Status = 'Finished'; |
||
| 35 | $firstStep->write(); |
||
| 36 | $pipeline->checkPipelineStatus(); |
||
| 37 | |||
| 38 | $this->assertEquals('Running', $pipeline->Status); |
||
|
1 ignored issue
–
show
|
|||
| 39 | $this->assertEquals(true, $pipeline->isRunning()); |
||
|
1 ignored issue
–
show
|
|||
| 40 | $this->assertDOSEquals(array( |
||
| 41 | array('Name'=>'step1', 'Status'=>'Finished'), |
||
| 42 | array('Name'=>'step2', 'Status'=>'Started'), |
||
| 43 | ), $pipeline->Steps()); |
||
| 44 | |||
| 45 | // Last step finished. Pipeline should fold now. |
||
| 46 | $lastStep = $pipeline->CurrentStep(); |
||
| 47 | $lastStep->Status = 'Finished'; |
||
| 48 | $lastStep->write(); |
||
| 49 | $pipeline->checkPipelineStatus(); |
||
| 50 | |||
| 51 | $this->assertEquals('Complete', $pipeline->Status); |
||
|
1 ignored issue
–
show
|
|||
| 52 | $this->assertEquals(false, $pipeline->isRunning()); |
||
|
1 ignored issue
–
show
|
|||
| 53 | $this->assertDOSEquals(array( |
||
| 54 | array('Name'=>'step1', 'Status'=>'Finished'), |
||
| 55 | array('Name'=>'step2', 'Status'=>'Finished'), |
||
| 56 | ), $pipeline->Steps()); |
||
| 57 | } |
||
| 58 | |||
| 232 |
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.