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 @@ -100,4 +100,18 @@ public function testClear()
100
100
$ this ->assertNotSame ($ enum1 , $ enum2 );
101
101
$ this ->assertSame ($ enum2 , $ enum3 );
102
102
}
103
+
104
+ public function testCloneNotCallableAndThrowsLogicException ()
105
+ {
106
+ $ enum = MabeEnumTest_TestAsset_EnumWithoutDefaultValue::ONE ();
107
+
108
+ $ reflectionClass = new ReflectionClass ($ enum );
109
+ $ reflectionMethod = $ reflectionClass ->getMethod ('__clone ' );
110
+ $ this ->assertTrue ($ reflectionMethod ->isPrivate (), 'The method __clone must be private ' );
111
+ $ this ->assertTrue ($ reflectionMethod ->isFinal (), 'The method __clone must be final ' );
112
+
113
+ $ reflectionMethod ->setAccessible (true );
114
+ $ this ->setExpectedException ('LogicException ' );
115
+ $ reflectionMethod ->invoke ($ enum );
116
+ }
103
117
}
You can’t perform that action at this time.
0 commit comments