File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -107,4 +107,18 @@ public function testClear()
107
107
$ this ->assertNotSame ($ enum1 , $ enum2 );
108
108
$ this ->assertSame ($ enum2 , $ enum3 );
109
109
}
110
+
111
+ public function testCloneNotCallableAndThrowsLogicException ()
112
+ {
113
+ $ enum = MabeEnumTest_TestAsset_EnumWithoutDefaultValue::ONE ();
114
+
115
+ $ reflectionClass = new ReflectionClass ($ enum );
116
+ $ reflectionMethod = $ reflectionClass ->getMethod ('__clone ' );
117
+ $ this ->assertTrue ($ reflectionMethod ->isPrivate (), 'The method __clone must be private ' );
118
+ $ this ->assertTrue ($ reflectionMethod ->isFinal (), 'The method __clone must be final ' );
119
+
120
+ $ reflectionMethod ->setAccessible (true );
121
+ $ this ->setExpectedException ('LogicException ' );
122
+ $ reflectionMethod ->invoke ($ enum );
123
+ }
110
124
}
You can’t perform that action at this time.
0 commit comments