Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.
Common duplication problems, and corresponding solutions are:
| 1 | <?php |
||
| 14 | View Code Duplication | class LockCommandTest extends AbstractCommandTest |
|
| 15 | { |
||
| 16 | /** |
||
| 17 | * Delete fixtured members after tests have run |
||
| 18 | */ |
||
| 19 | protected function tearDown() |
||
| 28 | |||
| 29 | protected function getTestCommand() |
||
| 33 | |||
| 34 | public function testExecute() |
||
| 45 | |||
| 46 | public function testMemberNotFound() |
||
| 51 | |||
| 52 | /** |
||
| 53 | * Creates a dummy user for testing with |
||
| 54 | * |
||
| 55 | * @return Member |
||
| 56 | */ |
||
| 57 | protected function createMember() |
||
| 65 | } |
||
| 66 |