ApiControllersTest::testApi()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 7
Ratio 100 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 7
loc 7
rs 9.4285
cc 1
eloc 4
nc 1
nop 2
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
Duplication introduced by
This class seems to be duplicated in your project.

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.

Loading history...
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