These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | |||
3 | namespace OpenOrchestra\FunctionalTests\WorkflowAdminBundle\Controller; |
||
4 | |||
5 | use OpenOrchestra\FunctionalTests\Utils\AbstractAuthenticatedTest; |
||
6 | |||
7 | /** |
||
8 | * Class ApiControllersTest |
||
9 | * |
||
10 | * @group apiFunctional |
||
11 | */ |
||
12 | View Code Duplication | class ApiControllersTest extends AbstractAuthenticatedTest |
|
0 ignored issues
–
show
|
|||
13 | { |
||
14 | /** |
||
15 | * @param string $url |
||
16 | * @param string $method |
||
17 | * |
||
18 | * @dataProvider provideApiUrl |
||
19 | */ |
||
20 | public function testApi($url, $method = 'GET') |
||
21 | { |
||
22 | $this->client->request($method, $url . '?access_token=' . $this->getAccessToken()); |
||
23 | |||
24 | $this->assertEquals(200, $this->client->getResponse()->getStatusCode()); |
||
25 | $this->assertSame('application/json', $this->client->getResponse()->headers->get('content-type')); |
||
26 | } |
||
27 | |||
28 | /** |
||
29 | * @return array |
||
30 | */ |
||
31 | public function provideApiUrl() |
||
32 | { |
||
33 | return array( |
||
34 | array('/api/workflow-profile'), |
||
35 | array('/api/workflow-profile/delete-multiple', 'DELETE'), |
||
36 | ); |
||
37 | } |
||
38 | } |
||
39 |
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.