5
5
use Neo4j \QueryAPI \OGM ;
6
6
use PHPUnit \Framework \TestCase ;
7
7
8
- final class Neo4jOGMTest extends TestCase
8
+ /**
9
+ * @api
10
+ */
11
+ class Neo4jOGMTest extends TestCase
9
12
{
13
+ /** @psalm-suppress PropertyNotSetInConstructor */
10
14
private OGM $ ogm ;
11
15
12
16
#[\Override]
@@ -31,9 +35,9 @@ public function testWithNode(): void
31
35
$ this ->assertEquals ('Ayush ' , $ node ->getProperties ()['name ' ]['_value ' ]);
32
36
}
33
37
34
-
35
38
public function testWithSimpleRelationship (): void
36
39
{
40
+
37
41
$ relationshipData = [
38
42
'$type ' => 'Relationship ' ,
39
43
'_value ' => [
@@ -43,10 +47,9 @@ public function testWithSimpleRelationship(): void
43
47
];
44
48
45
49
$ relationship = $ this ->ogm ->map ($ relationshipData );
46
- $ this ->assertEquals ('FRIENDS ' , $ relationship ->getType () );
50
+ $ this ->assertEquals ('FRIENDS ' , $ relationship ->type );
47
51
}
48
52
49
- // More tests...
50
53
public function testWithPath (): void
51
54
{
52
55
$ pathData = [
@@ -82,10 +85,10 @@ public function testWithPath(): void
82
85
83
86
$ path = $ this ->ogm ->map ($ pathData );
84
87
85
- $ this ->assertCount (2 , $ path ->getNodes () );
86
- $ this ->assertCount (1 , $ path ->getRelationships () );
87
- $ this ->assertEquals ('A ' , $ path ->getNodes () [0 ]->getProperties ()['name ' ]['_value ' ]);
88
- $ this ->assertEquals ('B ' , $ path ->getNodes () [1 ]->getProperties ()['name ' ]['_value ' ]);
88
+ $ this ->assertCount (2 , $ path ->nodes );
89
+ $ this ->assertCount (1 , $ path ->relationships );
90
+ $ this ->assertEquals ('A ' , $ path ->nodes [0 ]->getProperties ()['name ' ]['_value ' ]);
91
+ $ this ->assertEquals ('B ' , $ path ->nodes [1 ]->getProperties ()['name ' ]['_value ' ]);
89
92
}
90
93
91
94
}
0 commit comments