Guest User

Untitled

a guest
Jul 16th, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. /**
  2. * @covers ErrorHandling::__clone
  3. */
  4. public function test__cloneNotCloneable(){
  5. $class = new ReflectionClass('ErrorHandling');
  6. $method = $class->getMethod('__clone');
  7.  
  8. self::assertTrue($method->isFinal(), '__clone method is not final.');
  9. self::assertTrue($method->isPrivate(), '__clone method is not private.');
  10. }
  11.  
  12. /**
  13. * Define __clone as final and private to dissallow cloning.
  14. */
  15. private final function __clone(){}
  16.  
  17. // @codeCoverageIgnoreStart
  18. private function __clone() { }
  19. // @codeCoverageIgnoreEnd
Add Comment
Please, Sign In to add comment