Skip to content

Commit 14d43e9

Browse files
Add pattern clause examples tests
1 parent 01367e9 commit 14d43e9

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

tests/end-to-end/ExamplesTest.php

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,4 +101,34 @@ public function testCallProcedureClauseExample3(): void
101101

102102
$this->assertSame("CALL `dbms.security.createUser`('example_username', 'example_password', false)", $statement);
103103
}
104+
105+
public function testCreateClauseExample1(): void
106+
{
107+
$query = Query::new()
108+
->create(Query::node("Person"))
109+
->build();
110+
111+
$this->assertSame("CREATE (:Person)", $query);
112+
}
113+
114+
public function testCreateClauseExample2(): void
115+
{
116+
$query = Query::new()
117+
->create(Query::node("Person")->withVariable('n')->withProperties([
118+
'name' => 'Marijn',
119+
'title' => 'Maintainer'
120+
]))
121+
->build();
122+
123+
$this->assertSame("CREATE (n:Person {name: 'Marijn', title: 'Maintainer'})", $query);
124+
}
125+
126+
public function testCreateClauseExample3(): void
127+
{
128+
$query = Query::new()
129+
->create([Query::node("Person"), Query::node("Animal")])
130+
->build();
131+
132+
$this->assertSame("CREATE (:Person), (:Animal)", $query);
133+
}
104134
}

0 commit comments

Comments
 (0)