1 | <?php |
||
19 | class ChangeGroupsCommandTest extends AbstractCommandTest |
||
20 | { |
||
21 | /** |
||
22 | * Ensure a clean slate for each test run |
||
23 | * |
||
24 | * {@inheritDoc} |
||
25 | */ |
||
26 | public function setUp() |
||
31 | |||
32 | /** |
||
33 | * {@inheritDoc} |
||
34 | */ |
||
35 | protected function getTestCommand() |
||
39 | |||
40 | /** |
||
41 | * Test that an error message is returned if the Member does not exist |
||
42 | * |
||
43 | * @covers ::execute |
||
44 | */ |
||
45 | public function testReportMemberNotFound() |
||
50 | |||
51 | /** |
||
52 | * Test that when a Group is chosen from the multiselect list, the user is assigned to that Group or Groups |
||
53 | * |
||
54 | * @covers ::execute |
||
55 | */ |
||
56 | public function testAddToGroups() |
||
72 | |||
73 | /** |
||
74 | * Creates a dummy user for testing with |
||
75 | * |
||
76 | * @return Member |
||
77 | */ |
||
78 | protected function createMember() |
||
86 | |||
87 | /** |
||
88 | * Mock a QuestionHelper and tell it to return a predefined choice for which Group to assign |
||
89 | * |
||
90 | * @return QuestionHelper |
||
91 | */ |
||
92 | protected function mockQuestionHelper() |
||
117 | } |
||
118 |
This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.
Both the
$myVar
assignment in line 1 and the$higher
assignment in line 2 are dead. The first because$myVar
is never used and the second because$higher
is always overwritten for every possible time line.