Code Duplication    Length = 20-22 lines in 2 locations

tests/CouchDB/Tests/DatabaseTest.php 2 locations

@@ 210-231 (lines=22) @@
207
        $this->assertTrue($this->db->delete('some-doc', '946B7D1C'));
208
    }
209
210
    public function testFindAll()
211
    {
212
        $this->mock->append(new Response(200, [], '{
213
  "total_rows": 3, "offset": 0, "rows": [
214
    {"id": "doc1", "key": "doc1", "value": {"rev": "4324BB"}},
215
    {"id": "doc2", "key": "doc2", "value": {"rev":"2441HF"}},
216
    {"id": "doc3", "key": "doc3", "value": {"rev":"74EC24"}}
217
  ]
218
}'));
219
220
        $result = $this->db->findAll(0, 'doc1');
221
222
        $this->assertEquals(3, $result['total_rows']);
223
        $this->assertEquals(0, $result['offset']);
224
        $this->assertCount(3, $result['rows']);
225
226
        $request = $this->mock->getLastRequest();
227
228
        $this->assertEquals('GET', $request->getMethod());
229
        $this->assertEquals('/test/_all_docs', $request->getUri()->getPath());
230
        $this->assertEquals('include_docs=true&limit=0&startkey=doc1', $request->getUri()->getQuery());
231
    }
232
233
    public function testFindDocuments()
234
    {
@@ 233-252 (lines=20) @@
230
        $this->assertEquals('include_docs=true&limit=0&startkey=doc1', $request->getUri()->getQuery());
231
    }
232
233
    public function testFindDocuments()
234
    {
235
        $this->mock->append(new Response(200, [], '{
236
  "total_rows": 100, "offset": 0, "rows": [
237
    {"id": "doc1", "key": "1", "value": {"rev":"4324BB"}},
238
    {"id": "doc2", "key": "2", "value": {"rev":"2441HF"}}
239
  ]
240
}'));
241
242
        $docs = $this->db->findDocuments(['1', '2'], 0, 100);
243
        $this->assertEquals(100, $docs['total_rows']);
244
        $this->assertCount(2, $docs['rows']);
245
246
        $request = $this->mock->getLastRequest();
247
248
        $this->assertEquals('POST', $request->getMethod());
249
        $this->assertEquals('/test/_all_docs', $request->getUri()->getPath());
250
        $this->assertEquals('include_docs=true&limit=0&skip=100', $request->getUri()->getQuery());
251
        $this->assertEquals('{"keys":["1","2"]}', (string) $request->getBody());
252
    }
253
254
    public function testCreateBatchUpdater()
255
    {