Skip to content

Commit

Permalink
improved test assertation messages
Browse files Browse the repository at this point in the history
  • Loading branch information
cebe committed Oct 13, 2017
1 parent 92e12ce commit 24af146
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/Integration/IntegrationTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,12 @@ protected function persist(...$objects)

protected function assertGraphNotExist($q)
{
$this->assertTrue($this->checkGraph($q)->size() < 1);
$this->assertTrue($this->checkGraph($q)->size() < 1, "Failed asserting that the following graph does not exist: $q");
}

protected function assertGraphExist($q)
{
$this->assertTrue($this->checkGraph($q)->size() > 0);
$this->assertTrue($this->checkGraph($q)->size() > 0, "Failed asserting that the following graph exists: $q");
}

protected function checkGraph($q)
Expand All @@ -81,12 +81,12 @@ protected function checkGraph($q)

protected function assertNodesCount($count)
{
$this->assertSame($count, $this->client->run('MATCH (n) RETURN count(n) AS c')->firstRecord()->get('c'));
$this->assertSame($count, $this->client->run('MATCH (n) RETURN count(n) AS c')->firstRecord()->get('c'), "Failed asserting that node count is $count.");
}

protected function assertRelationshipsCount($count)
{
$this->assertSame($count, $this->client->run('MATCH (n)-[r]->(o) RETURN count(r) AS c')->firstRecord()->get('c'));
$this->assertSame($count, $this->client->run('MATCH (n)-[r]->(o) RETURN count(r) AS c')->firstRecord()->get('c'), "Failed asserting that relationship count is $count.");
}

protected function playMovies()
Expand Down

0 comments on commit 24af146

Please sign in to comment.