Code Duplication    Length = 12-26 lines in 2 locations

tests/CouchDB/Tests/ConnectionTest.php 1 location

@@ 36-61 (lines=26) @@
33
        $this->assertEquals('/test', $request->getUri()->getPath());
34
    }
35
36
    public function testSelectDatabase()
37
    {
38
        $this->mock->append(new Response(200, [], <<<JSON
39
{
40
    "compact_running": false,
41
    "db_name": "test",
42
    "disk_format_version": 5,
43
    "disk_size": 12377,
44
    "doc_count": 1,
45
    "doc_del_count": 1,
46
    "instance_start_time": "1267612389906234",
47
    "purge_seq": 0,
48
    "update_seq": 4
49
}
50
JSON
51
        ));
52
53
        $database = $this->connection->selectDatabase('test');
54
        $this->assertInstanceOf('CouchDB\\Database', $database);
55
        $this->assertEquals('test', $database->getName());
56
57
        $request = $this->mock->getLastRequest();
58
59
        $this->assertEquals('GET', $request->getMethod());
60
        $this->assertEquals('/test/', $request->getUri()->getPath());
61
    }
62
63
    public function testCreateExistingDatabase()
64
    {

tests/CouchDB/Tests/DatabaseTest.php 1 location

@@ 187-198 (lines=12) @@
184
        $this->db->update('john-doe', $doc);
185
    }
186
187
    public function testDelete()
188
    {
189
        $this->mock->append(new Response(200, [], '{"ok":true,"rev":"946B7D1C"}'));
190
191
        $this->assertTrue($this->db->delete('some-doc', '946B7D1C'));
192
193
        $request = $this->mock->getLastRequest();
194
195
        $this->assertEquals('DELETE', $request->getMethod());
196
        $this->assertEquals('/test/some-doc', $request->getUri()->getPath());
197
        $this->assertEquals('rev=946B7D1C', $request->getUri()->getQuery());
198
    }
199
200
    /**
201
     * @expectedException CouchDB\Exception\Exception