File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -423,6 +423,6 @@ private static function noAmbiguousValues($constants)
423
423
*/
424
424
final public static function __callStatic (string $ method , array $ args )
425
425
{
426
- return self ::byName ($ method );
426
+ return static ::byName ($ method );
427
427
}
428
428
}
Original file line number Diff line number Diff line change @@ -101,10 +101,22 @@ public function testEnumInheritance()
101
101
), EnumInheritance::getConstants ());
102
102
103
103
$ enum = EnumInheritance::get (EnumInheritance::ONE );
104
+ $ this ->assertInstanceOf (EnumInheritance::class, $ enum );
104
105
$ this ->assertSame (EnumInheritance::ONE , $ enum ->getValue ());
105
106
$ this ->assertSame (0 , $ enum ->getOrdinal ());
106
107
107
108
$ enum = EnumInheritance::get (EnumInheritance::INHERITANCE );
109
+ $ this ->assertInstanceOf (EnumInheritance::class, $ enum );
110
+ $ this ->assertSame (EnumInheritance::INHERITANCE , $ enum ->getValue ());
111
+ $ this ->assertSame (17 , $ enum ->getOrdinal ());
112
+
113
+ $ enum = EnumInheritance::ONE ();
114
+ $ this ->assertInstanceOf (EnumInheritance::class, $ enum );
115
+ $ this ->assertSame (EnumInheritance::ONE , $ enum ->getValue ());
116
+ $ this ->assertSame (0 , $ enum ->getOrdinal ());
117
+
118
+ $ enum = EnumInheritance::INHERITANCE ();
119
+ $ this ->assertInstanceOf (EnumInheritance::class, $ enum );
108
120
$ this ->assertSame (EnumInheritance::INHERITANCE , $ enum ->getValue ());
109
121
$ this ->assertSame (17 , $ enum ->getOrdinal ());
110
122
}
You can’t perform that action at this time.
0 commit comments