File tree Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change
1
+ <?php declare (strict_types=1 );
2
+ /*
3
+ * This file is part of php-cypher-dsl.
4
+ *
5
+ * Copyright (C) Wikibase Solutions
6
+ *
7
+ * For the full copyright and license information, please view the LICENSE
8
+ * file that was distributed with this source code.
9
+ */
10
+ namespace WikibaseSolutions \CypherDSL \Tests \EndToEnd ;
11
+
12
+ use PHPUnit \Framework \TestCase ;
13
+ use WikibaseSolutions \CypherDSL \Query ;
14
+
15
+ /**
16
+ * This class contains some end-to-end tests to test the examples in the wiki.
17
+ *
18
+ * @coversNothing
19
+ *
20
+ * @see https://github.com/neo4j-php/php-cypher-dsl/wiki
21
+ */
22
+ final class ExamplesTest extends TestCase
23
+ {
24
+ public function testReadmeExample (): void
25
+ {
26
+ $ tom = Query::node ("Person " )->withProperties (["name " => "Tom Hanks " ]);
27
+ $ coActors = Query::node ();
28
+
29
+ $ statement = Query::new ()
30
+ ->match ($ tom ->relationshipTo (Query::node (), "ACTED_IN " )->relationshipFrom ($ coActors , "ACTED_IN " ))
31
+ ->returning ($ coActors ->property ("name " ))
32
+ ->build ();
33
+
34
+ $ this ->assertStringMatchesFormat ("MATCH (:Person {name: 'Tom Hanks'})-[:ACTED_IN]->()<-[:ACTED_IN]-(%s) RETURN %s.name " , $ statement );
35
+ }
36
+ }
You can’t perform that action at this time.
0 commit comments