99
1010class Neo4jQueryAPIIntegrationTest extends TestCase
1111{
12-
1312 /**
1413 * @throws GuzzleException
1514 */
1615 public static function setUpBeforeClass (): void
1716 {
1817 $ api = Neo4jQueryAPI::login (
19- ' https://bb79fe35.databases.neo4j.io ' ,
20- ' neo4j ' ,
21- ' OXDRMgdWFKMcBRCBrIwXnKkwLgDlmFxipnywT6t_AK0 '
18+ getenv ( ' NEO4J_ADDRESS ' ) ,
19+ getenv ( ' NEO4J_USERNAME ' ) ,
20+ getenv ( ' NEO4J_PASSWORD ' )
2221 );
2322
2423 // Clear the database
@@ -94,7 +93,8 @@ public function testRunSuccessWithParameters(
9493 public static function queryProvider (): array
9594 {
9695 return [
97- [
96+ // Basic test with exact names
97+ 'testWithExactNames ' => [
9898 'https://bb79fe35.databases.neo4j.io ' ,
9999 'neo4j ' ,
100100 'OXDRMgdWFKMcBRCBrIwXnKkwLgDlmFxipnywT6t_AK0 ' ,
@@ -107,6 +107,57 @@ public static function queryProvider(): array
107107 ],
108108 ],
109109 ],
110+
111+ // Test with no matching names
112+ 'testWithNoMatchingNames ' => [
113+ 'https://bb79fe35.databases.neo4j.io ' ,
114+ 'neo4j ' ,
115+ 'OXDRMgdWFKMcBRCBrIwXnKkwLgDlmFxipnywT6t_AK0 ' ,
116+ 'MATCH (n:Person) WHERE n.name IN $names RETURN n.name ' ,
117+ ['names ' => ['charlie ' , 'david ' ]],
118+ [
119+ 'data ' => [],
120+ ],
121+ ],
122+
123+ // Test with a single name
124+ 'testWithSingleName ' => [
125+ 'https://bb79fe35.databases.neo4j.io ' ,
126+ 'neo4j ' ,
127+ 'OXDRMgdWFKMcBRCBrIwXnKkwLgDlmFxipnywT6t_AK0 ' ,
128+ 'MATCH (n:Person) WHERE n.name = $name RETURN n.name ' ,
129+ ['name ' => 'bob1 ' ],
130+ [
131+ 'data ' => [
132+ ['row ' => ['n.name ' => 'bob1 ' ]],
133+ ],
134+ ],
135+ ],
136+
137+ // Test for non-existent label
138+ 'testWithNonExistentLabel ' => [
139+ 'https://bb79fe35.databases.neo4j.io ' ,
140+ 'neo4j ' ,
141+ 'OXDRMgdWFKMcBRCBrIwXnKkwLgDlmFxipnywT6t_AK0 ' ,
142+ 'MATCH (n:NonExistentLabel) RETURN n ' ,
143+ [],
144+ [
145+ 'data ' => [],
146+ ],
147+ ],
148+
149+
150+ // Test with an invalid query that should return an error
151+ 'testWithInvalidQuery ' => [
152+ 'https://bb79fe35.databases.neo4j.io ' ,
153+ 'neo4j ' ,
154+ 'OXDRMgdWFKMcBRCBrIwXnKkwLgDlmFxipnywT6t_AK0 ' ,
155+ 'MATCH (n:Person) WHERE n.nonexistentProperty = $value RETURN n.name ' ,
156+ ['value ' => 'someValue ' ],
157+ [
158+ 'data ' => [],
159+ ],
160+ ],
110161 ];
111162 }
112163}
0 commit comments