File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed
tests/Unit/MartinGeorgiev/Doctrine/DBAL/Types/ValueObject Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,22 @@ public static function badPathFromRootProvider(): iterable
3939 yield 'list with dotted string ' => [['a ' , 'b.c ' , 'ds ' ]];
4040 }
4141
42+ #[DataProvider('badRepresentationProvider ' )]
43+ public function test_from_string_throws_on_bad_value (string $ value ): void
44+ {
45+ $ this ->expectException (\InvalidArgumentException::class);
46+ Ltree::fromString ($ value );
47+ }
48+
49+ /**
50+ * @return iterable<string, string[]>
51+ */
52+ public static function badRepresentationProvider (): iterable
53+ {
54+ yield 'string starting with dot ' => ['.b ' ];
55+ yield 'string ending with dot ' => ['a. ' ];
56+ }
57+
4258 /**
4359 * @param list<non-empty-string> $expected
4460 */
@@ -95,7 +111,6 @@ public function test_json_encode(): void
95111 #[DataProvider('parentProvider ' )]
96112 public function test_get_parent (LtreeInterface $ child , LtreeInterface $ parent ): void
97113 {
98- $ child ->getPathFromRoot ();
99114 $ ltree = $ child ->getParent ();
100115 self ::assertSame ((string ) $ parent , (string ) $ ltree );
101116 }
You can’t perform that action at this time.
0 commit comments