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 |
||
8 | final class SecurityControllerTest extends WebTestCase |
||
9 | { |
||
10 | 1 | View Code Duplication | public function testPublicAction() |
17 | |||
18 | /** |
||
19 | * @expectedException \Symfony\Component\Security\Core\Exception\InsufficientAuthenticationException |
||
20 | * @expectedExceptionMessage Full authentication is required to access this resource. |
||
21 | */ |
||
22 | 1 | public function testPrivateAction() |
|
26 | |||
27 | protected static function getKernelClass() |
||
31 | } |
||
32 |