Skip to content

Commit 144eb35

Browse files
committed
more cleanup
1 parent 56b4034 commit 144eb35

File tree

2 files changed

+59
-5
lines changed

2 files changed

+59
-5
lines changed

tests/CollectionBasicTest.php

Lines changed: 53 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,15 @@ public function testCreateAndDeleteCollectionPre1_2()
8181
$connection = $this->connection;
8282
$collection = new Collection();
8383
$collectionHandler = new CollectionHandler($connection);
84-
84+
8585
$name = 'ArangoDB_PHP_TestSuite_TestCollection_01';
86+
87+
try {
88+
$collectionHandler->drop($name);
89+
} catch (Exception $e) {
90+
//Silence the exception
91+
}
92+
8693
$collection->setName($name);
8794
$response = $collectionHandler->add($collection);
8895

@@ -109,8 +116,15 @@ public function testCreateCollectionWithKeyOptionsAndVerifyProperties()
109116
$connection = $this->connection;
110117
$collection = new Collection();
111118
$collectionHandler = new CollectionHandler($connection);
112-
119+
113120
$name = 'ArangoDB_PHP_TestSuite_TestCollection_01';
121+
122+
try {
123+
$collectionHandler->drop($name);
124+
} catch (Exception $e) {
125+
//Silence the exception
126+
}
127+
114128
$collection->setName($name);
115129
$collection->setKeyOptions(
116130
array("type" => "autoincrement", "allowUserKeys" => false, "increment" => 5, "offset" => 10)
@@ -153,8 +167,15 @@ public function testCreateAndDeleteCollection()
153167
$connection = $this->connection;
154168
$collection = new Collection();
155169
$collectionHandler = new CollectionHandler($connection);
156-
170+
157171
$name = 'ArangoDB_PHP_TestSuite_TestCollection_01';
172+
173+
try {
174+
$collectionHandler->drop($name);
175+
} catch (Exception $e) {
176+
//Silence the exception
177+
}
178+
158179
$collection->setName($name);
159180
$collectionHandler->add($collection);
160181

@@ -180,8 +201,15 @@ public function testCreateAndDeleteEdgeCollection()
180201
$connection = $this->connection;
181202
$collection = new Collection();
182203
$collectionHandler = new CollectionHandler($connection);
183-
204+
184205
$name = 'ArangoDB_PHP_TestSuite_TestCollection_02';
206+
207+
try {
208+
$collectionHandler->drop($name);
209+
} catch (Exception $e) {
210+
//Silence the exception
211+
}
212+
185213
$collection->setName($name);
186214
$collection->setType(3);
187215
$collectionHandler->add($collection);
@@ -209,6 +237,13 @@ public function testCreateAndDeleteEdgeCollectionWithoutCreatingObject()
209237
$collectionHandler = new CollectionHandler($connection);
210238

211239
$name = 'ArangoDB_PHP_TestSuite_TestCollection_02';
240+
241+
try {
242+
$collectionHandler->drop($name);
243+
} catch (Exception $e) {
244+
//Silence the exception
245+
}
246+
212247
$options = array('type' => 3);
213248
$collectionHandler->create($name, $options);
214249

@@ -235,6 +270,13 @@ public function testCreateAndDeleteVolatileCollectionWithoutCreatingObject()
235270
$collectionHandler = new CollectionHandler($connection);
236271

237272
$name = 'ArangoDB_PHP_TestSuite_TestCollection_02';
273+
274+
try {
275+
$collectionHandler->drop($name);
276+
} catch (Exception $e) {
277+
//Silence the exception
278+
}
279+
238280
$options = array('isVolatile' => true);
239281
$collectionHandler->create($name, $options);
240282
$resultingCollection = $collectionHandler->get($name);
@@ -260,6 +302,13 @@ public function testCreateAndDeleteSystemCollectionWithoutCreatingObject()
260302
$collectionHandler = new CollectionHandler($connection);
261303

262304
$name = 'ArangoDB_PHP_TestSuite_TestCollection_02';
305+
306+
try {
307+
$collectionHandler->drop($name);
308+
} catch (Exception $e) {
309+
//Silence the exception
310+
}
311+
263312
$options = array('isSystem' => true, 'waitForSync' => true);
264313
$collectionHandler->create($name, $options);
265314

@@ -494,7 +543,6 @@ public function testGetIndex()
494543

495544
public function tearDown()
496545
{
497-
498546
try {
499547
$this->collectionHandler->drop('ArangoDB_PHP_TestSuite_IndexTestCollection');
500548
} catch (Exception $e) {

tests/TransactionTest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@ public function setUp()
3434
} catch (\Exception $e) {
3535
// don't bother us, if it's already deleted.
3636
}
37+
38+
try {
39+
$this->collectionHandler->delete('ArangoDB_PHP_TestSuite_TestCollection_02');
40+
} catch (Exception $e) {
41+
//Silence the exception
42+
}
3743

3844

3945
$this->collection1 = new Collection();

0 commit comments

Comments
 (0)