Conditions | 1 |
Paths | 1 |
Total Lines | 17 |
Code Lines | 8 |
Lines | 17 |
Ratio | 100 % |
Changes | 0 |
1 | <?php |
||
23 | public function testDeleteExistingRole_() |
||
24 | { |
||
25 | $this->getTestingAdmin(); |
||
26 | |||
27 | $role = factory(Role::class)->create(); |
||
28 | |||
29 | // send the HTTP request |
||
30 | $response = $this->apiCall($this->injectEndpointId($this->endpoint, $role->id), 'delete'); |
||
31 | |||
32 | // assert response status is correct |
||
33 | $this->assertEquals('202', $response->getStatusCode()); |
||
34 | |||
35 | // assert the returned message is correct |
||
36 | $this->assertResponseContainKeyValue([ |
||
37 | 'message' => 'Role (' . $role->id . ') Deleted Successfully.', |
||
38 | ], $response); |
||
39 | } |
||
40 | |||
42 |
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.