Skip to content

Commit

Permalink
Add tests for where
Browse files Browse the repository at this point in the history
  • Loading branch information
marijnvanwezel committed Jan 1, 2023
1 parent 36c1cc5 commit 9721043
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions tests/end-to-end/ExamplesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -691,6 +691,30 @@ public function testSkipClauseExample3(): void
$this->assertStringMatchesFormat("MATCH (%s) RETURN %s.name ORDER BY %s.name SKIP (5 ^ 2)", $query);
}

public function testWhereClauseExample1(): void
{
$n = node('Person');
$query = query()
->match($n)
->where($n->property('name')->equals('Peter'))
->returning($n)
->build();

$this->assertStringMatchesFormat("MATCH (%s:Person) WHERE (%s.name = 'Peter') RETURN %s", $query);
}

public function testWhereClauseExample2(): void
{
$n = node();
$query = query()
->match($n)
->where($n->labeled('Person'))
->returning($n)
->build();

$this->assertStringMatchesFormat("MATCH (%s) WHERE %s:Person RETURN %s", $query);
}

public function testCombiningClausesExample1(): void
{
$nineties = node("Movie");
Expand Down

0 comments on commit 9721043

Please sign in to comment.