Skip to content

Commit a46c562

Browse files
committed
Merge pull request #151 from frankmayer/devel
A bunch of corrections
2 parents 1269578 + 05ba9d3 commit a46c562

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

lib/triagens/ArangoDb/Document.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ public function __construct(array $options = array())
140140
* @param array $values - initial values for document
141141
* @param array $options - optional, initial options for document
142142
*
143-
* @return Document
143+
* @return Document|Edge
144144
*/
145145
public static function createFromArray(array $values, array $options = array())
146146
{

lib/triagens/ArangoDb/GraphHandler.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ public function createGraph(Graph $graph)
9191
return $graph->getAll();
9292
}
9393

94+
9495
/**
9596
* Get a graph
9697
*
@@ -265,7 +266,7 @@ public function getVertex($graphName, $vertexId, array $options = array())
265266
*
266267
* @since 1.2
267268
*/
268-
public function ReplaceVertex($graphName, $vertexId, Document $document, $options = array())
269+
public function replaceVertex($graphName, $vertexId, Document $document, $options = array())
269270
{
270271
$options = array_merge(array(self::OPTION_REVISION => false), $options);
271272

@@ -317,6 +318,7 @@ public function ReplaceVertex($graphName, $vertexId, Document $document, $option
317318
return true;
318319
}
319320

321+
320322
/**
321323
* Update an existing vertex in a graph, identified by graph name and vertex id
322324
*
@@ -547,7 +549,7 @@ public function getEdge($graphName, $edgeId, array $options = array())
547549
*
548550
* @since 1.2
549551
*/
550-
public function ReplaceEdge($graphName, $edgeId, $label, Edge $document, $options = array())
552+
public function replaceEdge($graphName, $edgeId, $label, Edge $document, $options = array())
551553
{
552554
$options = array_merge(array(self::OPTION_REVISION => false), $options);
553555

@@ -603,6 +605,7 @@ public function ReplaceEdge($graphName, $edgeId, $label, Edge $document, $option
603605
return true;
604606
}
605607

608+
606609
/**
607610
* Update an existing edge in a graph, identified by graph name and edge id
608611
*

tests/GraphExtendedTest.php

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
/**
1313
* Class GraphExtendedTest
14-
* Basic Tests for the Graph API implementation
14+
* Extended Tests for the Graph API implementation
1515
*
1616
* @property Connection $connection
1717
* @property Graph $graph
@@ -342,11 +342,10 @@ public function testSaveVerticesAndEdgeBetweenThemAndRemoveFirstVertexFirst()
342342

343343

344344
// Try to get the edge using GraphHandler
345-
// This should return true
345+
// This should cause an exception with a code of 404
346346
try {
347347
$e = null;
348-
$resultE = $this->graphHandler->getEdge($this->graphName, $this->edge1Name);
349-
$this->assertTrue($resultE, 'Did not return true!');
348+
$this->graphHandler->getEdge($this->graphName, $this->edge1Name);
350349
} catch (\Exception $e) {
351350
// don't bother us... just give us the $e
352351
}
@@ -443,11 +442,10 @@ public function testGetReplaceUpdateAndRemoveOnNonExistentObjects()
443442

444443

445444
// Try to get the edge using GraphHandler
446-
// This should return true
445+
// This should cause an exception with a code of 404
447446
try {
448447
$e = null;
449-
$resultE = $this->graphHandler->getEdge($this->graphName, $this->edge1Name);
450-
$this->assertTrue($resultE, 'Did not return true!');
448+
$this->graphHandler->getEdge($this->graphName, $this->edge1Name);
451449
} catch (\Exception $e) {
452450
// don't bother us... just give us the $e
453451
}

0 commit comments

Comments
 (0)