File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
tests/Unit/MartinGeorgiev/Doctrine/DBAL/Types/ValueObject Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -80,6 +80,15 @@ public function test_get_parent(): void
8080 self ::assertSame ('a.b ' , (string ) $ parent );
8181 }
8282
83+ public function test_get_parent_respect_immutability (): void
84+ {
85+ $ ltree = new Ltree (['a ' , 'b ' , 'c ' ]);
86+ $ parent = $ ltree ->getParent ();
87+ self ::assertNotSame ($ ltree , $ parent );
88+ self ::assertSame (['a ' , 'b ' , 'c ' ], $ ltree ->getBranch ());
89+ self ::assertSame ('a.b.c ' , (string ) $ ltree );
90+ }
91+
8392 public function test_get_parent_on_root (): void
8493 {
8594 $ ltree = new Ltree (['a ' ]);
@@ -97,8 +106,7 @@ public function test_create_leaf_empty_throws(): void
97106 {
98107 $ ltree = new Ltree (['a ' ]);
99108 $ this ->expectException (\InvalidArgumentException::class);
100- // @phpstan-ignore-next-line argument.type - Testing invalid type handling
101- $ ltree ->createLeaf ('' );
109+ $ ltree ->createLeaf ('' ); // @phpstan-ignore argument.type
102110 }
103111
104112 public function test_create_leaf_with_dot_throws (): void
You can’t perform that action at this time.
0 commit comments