@@ -19,6 +19,12 @@ private function arguments() {
1919 yield [new ReflectionObject ($ this ), 'reflection object ' ];
2020 }
2121
22+ /** @return iterable */
23+ private function packages () {
24+ yield ['lang.reflection.unittest ' , 'lang.reflection.unittest ' ];
25+ yield [__NAMESPACE__ , 'lang.reflection.unittest ' ];
26+ }
27+
2228 #[Test, Values(from: 'arguments ' )]
2329 public function of ($ argument ) {
2430 Assert::equals (nameof ($ this ), Reflection::of ($ argument )->name ());
@@ -29,14 +35,14 @@ public function type($argument) {
2935 Assert::equals (nameof ($ this ), Reflection::type ($ argument )->name ());
3036 }
3137
32- #[Test]
33- public function of_package_name ( ) {
34- Assert::instance ( Package::class , Reflection::of ( ' lang.reflection.unittest ' ));
38+ #[Test, Values(from: ' packages ' ) ]
39+ public function package ( $ argument , $ expected ) {
40+ Assert::equals ( new Package ( $ expected ) , Reflection::package ( $ argument ));
3541 }
3642
3743 #[Test]
38- public function package () {
39- Assert::instance (Package::class, Reflection::package ('lang.reflection.unittest ' ));
44+ public function of_package_name () {
45+ Assert::instance (Package::class, Reflection::of ('lang.reflection.unittest ' ));
4046 }
4147
4248 #[Test, Values([70000 , 70100 , 70200 , 70300 , 70400 ])]
0 commit comments