@@ 63-73 (lines=11) @@ | ||
60 | $this->assertEquals('/test/', $request->getUri()->getPath()); |
|
61 | } |
|
62 | ||
63 | public function testCreateExistingDatabase() |
|
64 | { |
|
65 | $this->mock->append(new Response(412, [], '')); |
|
66 | ||
67 | try { |
|
68 | $this->connection->createDatabase('test'); |
|
69 | $this->fail(); |
|
70 | } catch (Exception $e) { |
|
71 | $this->assertEquals('The database "test" already exist', $e->getMessage()); |
|
72 | } |
|
73 | } |
|
74 | ||
75 | /** |
|
76 | * @expectedException CouchDB\Exception\Exception |
|
@@ 93-103 (lines=11) @@ | ||
90 | $this->connection->createDatabase('Test'); |
|
91 | } |
|
92 | ||
93 | public function testGetNotExistingDatabase() |
|
94 | { |
|
95 | $this->mock->append(new Response(404, [])); |
|
96 | ||
97 | try { |
|
98 | $this->connection->selectDatabase('test'); |
|
99 | $this->fail(); |
|
100 | } catch (Exception $e) { |
|
101 | $this->assertEquals('The database "test" does not exist', $e->getMessage()); |
|
102 | } |
|
103 | } |
|
104 | ||
105 | public function testHasDatabase() |
|
106 | { |
|
@@ 131-141 (lines=11) @@ | ||
128 | $this->assertEquals('/test/', $request->getUri()->getPath()); |
|
129 | } |
|
130 | ||
131 | public function testDropNotExistDatabase() |
|
132 | { |
|
133 | $this->mock->append(new Response(404, [])); |
|
134 | ||
135 | try { |
|
136 | $this->connection->dropDatabase('test'); |
|
137 | $this->fail(); |
|
138 | } catch (Exception $e) { |
|
139 | $this->assertEquals('The database "test" does not exist', $e->getMessage()); |
|
140 | } |
|
141 | } |
|
142 | ||
143 | public function testGetVersion() |
|
144 | { |