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\LogBundle\Controller; |
||
4 | |||
5 | use OpenOrchestra\FunctionalTests\Utils\AbstractAuthenticatedTest; |
||
6 | |||
7 | /** |
||
8 | * Class ApiControllersTest |
||
9 | * |
||
10 | * @group apiFunctional |
||
11 | */ |
||
12 | class ApiControllersTest extends AbstractAuthenticatedTest |
||
13 | { |
||
14 | /** |
||
15 | * @param string $url |
||
16 | * |
||
17 | * @dataProvider provideApiUrl |
||
18 | */ |
||
19 | View Code Duplication | public function testApi($url) |
|
0 ignored issues
–
show
|
|||
20 | { |
||
21 | $this->markTestSkipped('To reactivate when API roles will be implemented'); |
||
22 | |||
23 | $this->client->request('GET', $url . '?access_token=' . $this->getAccessToken()); |
||
24 | |||
25 | $this->assertEquals(200, $this->client->getResponse()->getStatusCode()); |
||
26 | $this->assertSame('application/json', $this->client->getResponse()->headers->get('content-type')); |
||
27 | } |
||
28 | |||
29 | /** |
||
30 | * @return array |
||
31 | */ |
||
32 | public function provideApiUrl() |
||
33 | { |
||
34 | return array( |
||
35 | array('/api/log'), |
||
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.