@@ -30,6 +30,8 @@ protected function setUp(): void
30
30
'NonExistingInterface ' => true ,
31
31
ExistingTrait::class => false ,
32
32
'NonExistingTrait ' => true ,
33
+ ExistingEnum::class => false ,
34
+ 'NonExistingEnum ' => true ,
33
35
]);
34
36
}
35
37
@@ -92,6 +94,26 @@ public function testTraitExists()
92
94
$ this ->assertFalse (trait_exists ('\\NonExistingTraitReal ' ));
93
95
$ this ->assertFalse (trait_exists ('\\NonExistingTraitReal ' , false ));
94
96
}
97
+
98
+ public function testEnumExists ()
99
+ {
100
+ $ this ->assertFalse (enum_exists (ExistingEnum::class));
101
+ $ this ->assertFalse (enum_exists (ExistingEnum::class, false ));
102
+ $ this ->assertFalse (enum_exists ('\\' .ExistingEnum::class));
103
+ $ this ->assertFalse (enum_exists ('\\' .ExistingEnum::class, false ));
104
+ $ this ->assertTrue (enum_exists ('NonExistingEnum ' ));
105
+ $ this ->assertTrue (enum_exists ('NonExistingEnum ' , false ));
106
+ $ this ->assertTrue (enum_exists ('\\NonExistingEnum ' ));
107
+ $ this ->assertTrue (enum_exists ('\\NonExistingEnum ' , false ));
108
+ $ this ->assertTrue (enum_exists (ExistingEnumReal::class));
109
+ $ this ->assertTrue (enum_exists (ExistingEnumReal::class, false ));
110
+ $ this ->assertTrue (enum_exists ('\\' .ExistingEnumReal::class));
111
+ $ this ->assertTrue (enum_exists ('\\' .ExistingEnumReal::class, false ));
112
+ $ this ->assertFalse (enum_exists ('NonExistingClassReal ' ));
113
+ $ this ->assertFalse (enum_exists ('NonExistingClassReal ' , false ));
114
+ $ this ->assertFalse (enum_exists ('\\NonExistingEnumReal ' ));
115
+ $ this ->assertFalse (enum_exists ('\\NonExistingEnumReal ' , false ));
116
+ }
95
117
}
96
118
97
119
class ExistingClass
@@ -117,3 +139,11 @@ trait ExistingTrait
117
139
trait ExistingTraitReal
118
140
{
119
141
}
142
+
143
+ enum ExistingEnum
144
+ {
145
+ }
146
+
147
+ enum ExistingEnumReal
148
+ {
149
+ }
0 commit comments