Code Duplication    Length = 14-15 lines in 3 locations

Tests/ApiTest.php 3 locations

@@ 55-69 (lines=15) @@
52
        $this->assertEquals(201, $this->client->getResponse()->getStatusCode());
53
    }
54
55
    public function testApiPatch()
56
    {
57
        $this->createKeyValue('key_to_patch');
58
59
        $this->client->request(
60
            'PATCH',
61
            '/v1/keys/key_to_patch',
62
            [],
63
            [],
64
            ['HTTP_CONTENT_TYPE' => 'application/json', 'CONTENT_TYPE' => 'application/json'],
65
            json_encode(['value' => 'value_to_patch'])
66
        );
67
68
        $this->assertEquals(204, $this->client->getResponse()->getStatusCode());
69
    }
70
71
    public function testApiUpdate()
72
    {
@@ 71-85 (lines=15) @@
68
        $this->assertEquals(204, $this->client->getResponse()->getStatusCode());
69
    }
70
71
    public function testApiUpdate()
72
    {
73
        $this->createKeyValue('key_to_update');
74
75
        $this->client->request(
76
            'PUT',
77
            '/v1/keys/key_to_update',
78
            [],
79
            [],
80
            ['HTTP_CONTENT_TYPE' => 'application/json', 'CONTENT_TYPE' => 'application/json'],
81
            json_encode(['key' => 'key_to_update', 'value' => 'test_update_value'])
82
        );
83
84
        $this->assertEquals(204, $this->client->getResponse()->getStatusCode());
85
    }
86
87
    public function testApiDelete()
88
    {
@@ 87-100 (lines=14) @@
84
        $this->assertEquals(204, $this->client->getResponse()->getStatusCode());
85
    }
86
87
    public function testApiDelete()
88
    {
89
        $this->createKeyValue('key with space');
90
91
        $this->client->request(
92
            'DELETE',
93
            '/v1/keys/key with space',
94
            [],
95
            [],
96
            ['HTTP_CONTENT_TYPE' => 'application/json', 'CONTENT_TYPE' => 'application/json']
97
        );
98
99
        $this->assertEquals(204, $this->client->getResponse()->getStatusCode());
100
    }
101
102
    /**
103
     * createKeyValue.