| @@ 124-138 (lines=15) @@ | ||
| 121 | $this->assertEquals(400, $this->client->getResponse()->getStatusCode()); |
|
| 122 | } |
|
| 123 | ||
| 124 | public function testApiPatch() |
|
| 125 | { |
|
| 126 | $this->createKeyValue('key_to_patch'); |
|
| 127 | ||
| 128 | $this->client->request( |
|
| 129 | 'PATCH', |
|
| 130 | '/v1/keys/key_to_patch', |
|
| 131 | [], |
|
| 132 | [], |
|
| 133 | ['HTTP_CONTENT_TYPE' => 'application/json', 'CONTENT_TYPE' => 'application/json'], |
|
| 134 | json_encode(['value' => 'value_to_patch']) |
|
| 135 | ); |
|
| 136 | ||
| 137 | $this->assertEquals(204, $this->client->getResponse()->getStatusCode()); |
|
| 138 | } |
|
| 139 | ||
| 140 | public function testApiUpdate() |
|
| 141 | { |
|
| @@ 140-154 (lines=15) @@ | ||
| 137 | $this->assertEquals(204, $this->client->getResponse()->getStatusCode()); |
|
| 138 | } |
|
| 139 | ||
| 140 | public function testApiUpdate() |
|
| 141 | { |
|
| 142 | $this->createKeyValue('key_to_update'); |
|
| 143 | ||
| 144 | $this->client->request( |
|
| 145 | 'PUT', |
|
| 146 | '/v1/keys/key_to_update', |
|
| 147 | [], |
|
| 148 | [], |
|
| 149 | ['HTTP_CONTENT_TYPE' => 'application/json', 'CONTENT_TYPE' => 'application/json'], |
|
| 150 | json_encode(['key' => 'key_to_update', 'value' => 'test_update_value']) |
|
| 151 | ); |
|
| 152 | ||
| 153 | $this->assertEquals(204, $this->client->getResponse()->getStatusCode()); |
|
| 154 | } |
|
| 155 | ||
| 156 | public function testApiDelete() |
|
| 157 | { |
|
| @@ 156-169 (lines=14) @@ | ||
| 153 | $this->assertEquals(204, $this->client->getResponse()->getStatusCode()); |
|
| 154 | } |
|
| 155 | ||
| 156 | public function testApiDelete() |
|
| 157 | { |
|
| 158 | $this->createKeyValue('key with space'); |
|
| 159 | ||
| 160 | $this->client->request( |
|
| 161 | 'DELETE', |
|
| 162 | '/v1/keys/key with space', |
|
| 163 | [], |
|
| 164 | [], |
|
| 165 | ['HTTP_CONTENT_TYPE' => 'application/json', 'CONTENT_TYPE' => 'application/json'] |
|
| 166 | ); |
|
| 167 | ||
| 168 | $this->assertEquals(204, $this->client->getResponse()->getStatusCode()); |
|
| 169 | } |
|
| 170 | ||
| 171 | /** |
|
| 172 | * createKeyValue. |
|