Conditions | 1 |
Paths | 1 |
Total Lines | 32 |
Code Lines | 20 |
Lines | 32 |
Ratio | 100 % |
1 | <?php |
||
65 | View Code Duplication | public function testCanTrigger() { |
|
66 | $step = $this->getDummyConfirmationStep(); |
||
67 | |||
68 | $step->start(); |
||
69 | |||
70 | // can the author trigger the deploy |
||
71 | $member = Member::get_by_id('Member', $step->Pipeline()->AuthorID); |
||
72 | $member->logIn(); |
||
73 | |||
74 | $this->assertTrue($step->canTriggerDeploy()); |
||
1 ignored issue
–
show
|
|||
75 | |||
76 | // can another member with deploy permissions trigger the deploy |
||
77 | $member = Member::get() |
||
78 | ->filter('Email', '[email protected]') |
||
79 | ->first(); |
||
80 | $member->logIn(); |
||
81 | $this->assertTrue($step->canTriggerDeploy()); |
||
1 ignored issue
–
show
|
|||
82 | |||
83 | $this->logInWithPermission('APPLY_ROLES'); |
||
84 | $this->assertFalse($step->canTriggerDeploy()); |
||
85 | |||
86 | $this->logInWithPermission('ADMIN'); |
||
87 | $this->assertTrue($step->canTriggerDeploy()); |
||
1 ignored issue
–
show
|
|||
88 | |||
89 | // confirm other members without admin permissions can not trigger the deploy |
||
90 | $member = Member::get() |
||
91 | ->filter('Email', '[email protected]') |
||
92 | ->first(); |
||
93 | $member->logIn(); |
||
94 | $this->assertFalse($step->canTriggerDeploy()); |
||
95 | |||
96 | } |
||
97 | |||
124 |
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.