Total Complexity | 4 |
Total Lines | 50 |
Duplicated Lines | 60 % |
Changes | 3 | ||
Bugs | 0 | Features | 0 |
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 namespace GeneaLabs\LaravelCaffeine\Tests\Feature; |
||
5 | class CaffeineTest extends TestCase |
||
6 | { |
||
7 | public function testBootstrap3TestPageCanLoad() |
||
13 | } |
||
14 | |||
15 | public function testMiddlewareInjectsDripScript() |
||
22 | } |
||
23 | |||
24 | View Code Duplication | public function testSuccessfulDrip() |
|
1 ignored issue
–
show
|
|||
25 | { |
||
26 | $dripRoute = config('genealabs-laravel-caffeine.route', 'genealabs/laravel-caffeine/drip'); |
||
27 | $html = $this->get(route('genealabs-laravel-caffeine.tests.form')) |
||
28 | ->getContent(); |
||
29 | $matches = []; |
||
30 | preg_match('/<meta name="csrf-token" content="(.*?)">/', $html, $matches); |
||
31 | $csrfToken = $matches[1]; |
||
32 | |||
33 | $response = $this->get($dripRoute, [ |
||
34 | '_token' => $csrfToken, |
||
35 | ]); |
||
36 | |||
37 | $response->assertStatus(204); |
||
38 | } |
||
39 | |||
40 | View Code Duplication | public function testExpiredDrip() |
|
55 | } |
||
56 | } |
||
57 |