Skip to content

Commit de271d9

Browse files
committed
fixed tests
1 parent 144eb35 commit de271d9

File tree

2 files changed

+17
-5
lines changed

2 files changed

+17
-5
lines changed

lib/triagens/ArangoDb/EdgeHandler.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ public function replaceById($collectionId, $edgeId, Edge $edge, $options = array
363363
*
364364
* @param mixed $collectionId - collection id as string or number
365365
* @param mixed $edgeId - edge id as string or number
366-
* @param Edge $edge - patch edge which contains the attributes and values to be updated
366+
* @param Document $edge - patch edge which contains the attributes and values to be updated
367367
* @param mixed $options - optional, array of options (see below) or the boolean value for $policy (for compatibility prior to version 1.1 of this method)
368368
* <p>Options are :
369369
* <li>'policy' - update policy to be used in case of conflict ('error', 'last' or NULL [use default])</li>
@@ -373,7 +373,7 @@ public function replaceById($collectionId, $edgeId, Edge $edge, $options = array
373373
*
374374
* @return bool - always true, will throw if there is an error
375375
*/
376-
public function updateById($collectionId, $edgeId, Edge $edge, $options = array())
376+
public function updateById($collectionId, $edgeId, Document $edge, $options = array())
377377
{
378378
return $this->patch(Urls::URL_EDGE, $collectionId, $edgeId, $edge, $options);
379379
}

tests/EdgeBasicTest.php

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,27 @@ public function setUp()
2828
{
2929
$this->connection = getConnection();
3030
$this->collectionHandler = new CollectionHandler($this->connection);
31+
32+
try {
33+
$this->collectionHandler->delete('ArangoDBPHPTestSuiteTestEdgeCollection01');
34+
} catch (\Exception $e) {
35+
#don't bother us, if it's already deleted.
36+
}
37+
38+
try {
39+
$this->collectionHandler->delete('ArangoDBPHPTestSuiteTestCollection01');
40+
} catch (\Exception $e) {
41+
#don't bother us, if it's already deleted.
42+
}
43+
3144
$this->edgeCollection = new Collection();
3245
$this->edgeCollection->setName('ArangoDBPHPTestSuiteTestEdgeCollection01');
3346
$this->edgeCollection->set('type', 3);
47+
3448
$this->collection = new Collection();
3549
$this->collection->setName('ArangoDBPHPTestSuiteTestCollection01');
36-
50+
3751
$this->collectionHandler->add($this->edgeCollection);
38-
3952
$this->collectionHandler->add($this->collection);
4053
}
4154

@@ -49,7 +62,6 @@ public function testInitializeEdge()
4962
$this->collectionHandler = new CollectionHandler($this->connection);
5063
$document = new Edge();
5164
$this->assertInstanceOf('triagens\ArangoDb\Edge', $document);
52-
$this->assertInstanceOf('triagens\ArangoDb\Edge', $document);
5365
unset ($document);
5466
}
5567

0 commit comments

Comments
 (0)