Code Duplication    Length = 7-13 lines in 8 locations

src/Graviton/CoreBundle/Tests/Controller/PrimitiveArrayControllerTest.php 2 locations

@@ 44-53 (lines=10) @@
41
     *
42
     * @return void
43
     */
44
    public function testItemSchema()
45
    {
46
        $client = static::createRestClient();
47
        $client->request('GET', '/schema/testcase/primitivearray/item');
48
        $this->assertEquals(Response::HTTP_OK, $client->getResponse()->getStatusCode());
49
50
        $schema = $client->getResults();
51
        $this->assertEquals('object', $schema->type);
52
        $this->assertItemSchema($schema);
53
    }
54
55
    /**
56
     * Test collection schema
@@ 77-85 (lines=9) @@
74
     *
75
     * @return void
76
     */
77
    public function testCheckGetOne()
78
    {
79
        $client = static::createRestClient();
80
        $client->request('GET', '/testcase/primitivearray/testdata');
81
        $this->assertEquals(Response::HTTP_OK, $client->getResponse()->getStatusCode());
82
        $this->assertNotEmpty($client->getResults());
83
84
        $this->assertFixtureData($client->getResults());
85
    }
86
87
    /**
88
     * Test GET all method

src/Graviton/CoreBundle/Tests/Controller/TranslatableArrayControllerTest.php 3 locations

@@ 50-59 (lines=10) @@
47
     *
48
     * @return void
49
     */
50
    public function testItemSchema()
51
    {
52
        $client = static::createRestClient();
53
        $this->getRequest($client, '/schema/testcase/translatable-array/item');
54
        $this->assertEquals(Response::HTTP_OK, $client->getResponse()->getStatusCode());
55
56
        $schema = $client->getResults();
57
        $this->assertEquals('object', $schema->type);
58
        $this->assertItemSchema($schema);
59
    }
60
61
    /**
62
     * Test collection schema
@@ 83-91 (lines=9) @@
80
     *
81
     * @return void
82
     */
83
    public function testCheckGetOne()
84
    {
85
        $client = static::createRestClient();
86
        $this->getRequest($client, '/testcase/translatable-array/testdata');
87
        $this->assertEquals(Response::HTTP_OK, $client->getResponse()->getStatusCode());
88
        $this->assertNotEmpty($client->getResults());
89
90
        $this->assertFixtureData($client->getResults());
91
    }
92
93
    /**
94
     * Test GET all method
@@ 98-106 (lines=9) @@
95
     *
96
     * @return void
97
     */
98
    public function testCheckGetAll()
99
    {
100
        $client = static::createRestClient();
101
        $this->getRequest($client, '/testcase/translatable-array/');
102
        $this->assertEquals(Response::HTTP_OK, $client->getResponse()->getStatusCode());
103
        $this->assertCount(1, $client->getResults());
104
105
        $this->assertFixtureData($client->getResults()[0]);
106
    }
107
108
    /**
109
     * Test POST method

src/Graviton/CoreBundle/Tests/Services/ReadOnlyServiceTest.php 1 location

@@ 41-51 (lines=11) @@
38
     *
39
     * @return void
40
     */
41
    public function testAllowedMethod()
42
    {
43
        $client = static::createRestClient();
44
        $client->request('GET', "/testcase/readonly/");
45
46
        $response = $client->getResponse();
47
        $result = $client->getResults();
48
49
        $this->assertEquals(Response::HTTP_OK, $response->getStatusCode());
50
        $this->assertCount(2, $result);
51
    }
52
53
    /**
54
     * test not allowed methods of a readOnly service

src/Graviton/SecurityBundle/Tests/Controller/WhoAmIControllerTest.php 1 location

@@ 40-52 (lines=13) @@
37
     *
38
     * @return void
39
     */
40
    public function testVersionsSchemaAction()
41
    {
42
        $client = static::createRestClient();
43
        $client->request('GET', '/schema/person/whoami');
44
        $response = $client->getResponse();
45
46
        $this->assertEquals(
47
            '{"username":{"title":"The username of the logged in consultant","description":"your username",'.
48
            '"type":"string"},"additionalProperties":true}',
49
            $response->getContent()
50
        );
51
        $this->assertInternalType('string', $response->getContent());
52
    }
53
}
54

src/Graviton/CoreBundle/Tests/Controller/ShowcaseControllerTest.php 1 location

@@ 881-887 (lines=7) @@
878
     * @dataProvider rqlDataProvider
879
     * @return void
880
     */
881
    public function testTrigger301($url, $redirectUrl)
882
    {
883
        $client = static::createRestClient();
884
        $client->request('GET', $url);
885
        $this->assertEquals(301, $client->getResponse()->getStatusCode());
886
        $this->assertEquals($redirectUrl, $client->getResponse()->headers->get('Location'));
887
    }
888
889
    /**
890
     * Provides urls for the testTrigger301() test.