| Conditions | 1 |
| Paths | 1 |
| Total Lines | 32 |
| Code Lines | 20 |
| Lines | 32 |
| Ratio | 100 % |
| 1 | <?php |
||
| 77 | View Code Duplication | public function testCanRollback() { |
|
| 78 | $step = $this->getDummyConfirmationStep(); |
||
| 79 | |||
| 80 | $step->start(); |
||
| 81 | |||
| 82 | // can the author trigger a rollback |
||
| 83 | $member = Member::get_by_id('Member', $step->Pipeline()->AuthorID); |
||
| 84 | $member->logIn(); |
||
| 85 | |||
| 86 | $this->assertTrue($step->canTriggerRollback()); |
||
|
1 ignored issue
–
show
|
|||
| 87 | |||
| 88 | // can another member with deploy permissions trigger a rollback |
||
| 89 | $member = Member::get() |
||
| 90 | ->filter('Email', '[email protected]') |
||
| 91 | ->first(); |
||
| 92 | $member->logIn(); |
||
| 93 | $this->assertTrue($step->canTriggerRollback()); |
||
|
1 ignored issue
–
show
|
|||
| 94 | |||
| 95 | $this->logInWithPermission('APPLY_ROLES'); |
||
| 96 | $this->assertFalse($step->canTriggerRollback()); |
||
| 97 | |||
| 98 | $this->logInWithPermission('ADMIN'); |
||
| 99 | $this->assertTrue($step->canTriggerRollback()); |
||
|
1 ignored issue
–
show
|
|||
| 100 | |||
| 101 | // confirm other members without admin permissions can not trigger a rollback |
||
| 102 | $member = Member::get() |
||
| 103 | ->filter('Email', '[email protected]') |
||
| 104 | ->first(); |
||
| 105 | $member->logIn(); |
||
| 106 | $this->assertFalse($step->canTriggerRollback()); |
||
| 107 | |||
| 108 | } |
||
| 109 | |||
| 142 |
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.