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 |
||
12 | class SimpleBasicAuthTest extends TestCase |
||
|
|||
13 | { |
||
14 | /** @test */ |
||
15 | View Code Duplication | public function it_should_return_access_denied_on_empty_credentials() |
|
26 | |||
27 | /** @test */ |
||
28 | View Code Duplication | public function it_should_return_access_denied_on_wrong_credentials() |
|
39 | |||
40 | /** @test */ |
||
41 | View Code Duplication | public function it_should_return_ok_on_disabled_auth() |
|
53 | |||
54 | /** @test */ |
||
55 | View Code Duplication | public function it_should_return_ok_with_credentials() |
|
66 | |||
67 | protected function getEnvironmentSetUp($app) |
||
76 | } |
||
77 |