Skip to content

Commit 9721043

Browse files
Add tests for where
1 parent 36c1cc5 commit 9721043

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

tests/end-to-end/ExamplesTest.php

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -691,6 +691,30 @@ public function testSkipClauseExample3(): void
691691
$this->assertStringMatchesFormat("MATCH (%s) RETURN %s.name ORDER BY %s.name SKIP (5 ^ 2)", $query);
692692
}
693693

694+
public function testWhereClauseExample1(): void
695+
{
696+
$n = node('Person');
697+
$query = query()
698+
->match($n)
699+
->where($n->property('name')->equals('Peter'))
700+
->returning($n)
701+
->build();
702+
703+
$this->assertStringMatchesFormat("MATCH (%s:Person) WHERE (%s.name = 'Peter') RETURN %s", $query);
704+
}
705+
706+
public function testWhereClauseExample2(): void
707+
{
708+
$n = node();
709+
$query = query()
710+
->match($n)
711+
->where($n->labeled('Person'))
712+
->returning($n)
713+
->build();
714+
715+
$this->assertStringMatchesFormat("MATCH (%s) WHERE %s:Person RETURN %s", $query);
716+
}
717+
694718
public function testCombiningClausesExample1(): void
695719
{
696720
$nineties = node("Movie");

0 commit comments

Comments
 (0)