@@ -11,15 +11,14 @@ class FullyQualifiedClassNameTest extends TestCase
1111 public function patternProvider (): array
1212 {
1313 return [
14- ['Food\Vegetables\Fruits\Banana ' , 'Food\Vegetables\Fruits\Banana ' , true ],
15- ['Food\Vegetables\Fruits\Banana ' , 'Food\Vegetables\*\Banana ' , true ],
16- ['Food\Vegetables\Fruits\Banana ' , 'Food\Vegetables ' , true ],
14+ ['Food\Vegetables\Fruits\Banana ' , 'Food\Vegetables\Fruits\Banana ' , true ],
15+ ['Food\Vegetables\Fruits\Banana ' , 'Food\Vegetables\*\Banana ' , true ],
16+ ['Food\Vegetables\Fruits\Banana ' , 'Food\Vegetables ' , true ],
1717 ['Food\Vegetables\Fruits\Banana ' , 'Food\Vegetables \\' , true ],
18-
1918 ['Food\Vegetables\Fruits\Banana ' , 'Food\Vegetables\* ' , true ],
20- ['Food\Vegetables\Fruits\Mango ' , '' , false ],
21- ['Food\Veg ' , 'Food\Vegetables ' , false ],
22- ['Food\Vegetables ' , 'Food\Veg ' , false ],
19+ ['Food\Vegetables\Fruits\Mango ' , '' , false ],
20+ ['Food\Veg ' , 'Food\Vegetables ' , false ],
21+ ['Food\Vegetables ' , 'Food\Veg ' , false ],
2322 ];
2423 }
2524
@@ -41,6 +40,12 @@ public function test_should_throw_if_invalid_namespace_is_passed(): void
4140 FullyQualifiedClassName::fromString ('-Gvnn ' );
4241 }
4342
43+ public function test_single_letter_class_is_valid (): void
44+ {
45+ $ fqcn = FullyQualifiedClassName::fromString ('A ' );
46+ $ this ->assertEquals ('A ' , $ fqcn ->className ());
47+ }
48+
4449 public function test_should_return_class_name (): void
4550 {
4651 $ fqcn = FullyQualifiedClassName::fromString ('Food\Vegetables\Fruits\Banana ' );
0 commit comments