@@ -44,7 +44,7 @@ public static function provideInvalidPathFromRoot(): iterable
4444
4545 #[DataProvider('provideInvalidStringRepresentation ' )]
4646 #[Test]
47- public function throws_exception_for_invalid_string_represensation (string $ value ): void
47+ public function throws_exception_for_invalid_string_representation (string $ value ): void
4848 {
4949 $ this ->expectException (InvalidLtreeException::class);
5050 Ltree::fromString ($ value );
@@ -63,6 +63,7 @@ public static function provideInvalidStringRepresentation(): iterable
6363 * @param list<non-empty-string> $expected
6464 */
6565 #[DataProvider('provideValidRepresentation ' )]
66+ #[Test]
6667 public function can_create_from_string (string $ value , array $ expected ): void
6768 {
6869 $ ltree = Ltree::fromString ($ value );
@@ -74,6 +75,7 @@ public function can_create_from_string(string $value, array $expected): void
7475 * @param list<non-empty-string> $value
7576 */
7677 #[DataProvider('provideValidRepresentation ' )]
78+ #[Test]
7779 public function can_convert_to_string (string $ expected , array $ value ): void
7880 {
7981 $ ltree = new Ltree ($ value );
@@ -84,6 +86,7 @@ public function can_convert_to_string(string $expected, array $value): void
8486 * @param list<non-empty-string> $expected
8587 */
8688 #[DataProvider('provideValidRepresentation ' )]
89+ #[Test]
8790 public function can_serialize_to_json (string $ value , array $ expected ): void
8891 {
8992 $ ltreeFromString = Ltree::fromString ($ value );
@@ -109,7 +112,7 @@ public static function provideValidRepresentation(): iterable
109112 public function can_encode_to_json_array (): void
110113 {
111114 $ ltree = new Ltree (['a ' , 'b ' , 'c ' ]);
112- $ json = \json_encode ($ ltree );
115+ $ json = \json_encode ($ ltree, \ JSON_THROW_ON_ERROR );
113116 self ::assertSame ('["a","b","c"] ' , $ json );
114117 }
115118
@@ -125,7 +128,6 @@ public function can_get_parent(Ltree $child, Ltree $parent): void
125128 #[Test]
126129 public function respect_immutability_when_getting_parent (Ltree $ child , Ltree $ parent ): void
127130 {
128- unset($ parent );
129131 $ childAsString = (string ) $ child ;
130132 $ ltree = $ child ->getParent ();
131133 self ::assertNotSame ($ child , $ ltree , 'getParent() should return a new instance ' );
@@ -177,13 +179,13 @@ public function can_verify_root_status(): void
177179 }
178180
179181 /**
180- * @param $expected array{
181- * isAncestorOf: bool,
182- * isDescendantOf: bool,
183- * isParentOf: bool,
184- * isChildOf: bool,
185- * isSiblingOf: bool,
186- * }
182+ * @param array{
183+ * isAncestorOf: bool,
184+ * isDescendantOf: bool,
185+ * isParentOf: bool,
186+ * isChildOf: bool,
187+ * isSiblingOf: bool,
188+ * } $expected
187189 */
188190 #[DataProvider('provideFamilyRelationshipWithExpectedResults ' )]
189191 #[Test]
@@ -196,7 +198,7 @@ public function can_verify_relationship(
196198 self ::assertSame (
197199 $ value ,
198200 $ left ->{$ method }($ right ),
199- \sprintf ('Failed %s check ' , $ method ),
201+ \sprintf ('Failed %s check ' , $ method ),
200202 );
201203 }
202204 }
@@ -484,8 +486,6 @@ public function can_create_leaf(Ltree $parent, string $leaf, Ltree $expected): v
484486 #[Test]
485487 public function respects_immutability_when_creating_leaf (Ltree $ parent , string $ leaf , Ltree $ expected ): void
486488 {
487- unset($ expected );
488-
489489 $ parentAsString = (string ) $ parent ;
490490 $ ltree = $ parent ->withLeaf ($ leaf );
491491 self ::assertNotSame ($ parent , $ ltree , 'withLeaf() should return a new instance ' );
0 commit comments