mocked_class.tpl.dist 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. {prologue}{class_declaration}
  2. {
  3. private $__phpunit_invocationMocker;
  4. private $__phpunit_originalObject;
  5. private $__phpunit_configurable = {configurable};
  6. private $__phpunit_returnValueGeneration = true;
  7. {clone}{mocked_methods}
  8. public function expects(\PHPUnit\Framework\MockObject\Matcher\Invocation $matcher)
  9. {
  10. return $this->__phpunit_getInvocationMocker()->expects($matcher);
  11. }
  12. {method}
  13. public function __phpunit_setOriginalObject($originalObject)
  14. {
  15. $this->__phpunit_originalObject = $originalObject;
  16. }
  17. public function __phpunit_setReturnValueGeneration(bool $returnValueGeneration)
  18. {
  19. $this->__phpunit_returnValueGeneration = $returnValueGeneration;
  20. }
  21. public function __phpunit_getInvocationMocker()
  22. {
  23. if ($this->__phpunit_invocationMocker === null) {
  24. $this->__phpunit_invocationMocker = new \PHPUnit\Framework\MockObject\InvocationMocker($this->__phpunit_configurable, $this->__phpunit_returnValueGeneration);
  25. }
  26. return $this->__phpunit_invocationMocker;
  27. }
  28. public function __phpunit_hasMatchers()
  29. {
  30. return $this->__phpunit_getInvocationMocker()->hasMatchers();
  31. }
  32. public function __phpunit_verify(bool $unsetInvocationMocker = true)
  33. {
  34. $this->__phpunit_getInvocationMocker()->verify();
  35. if ($unsetInvocationMocker) {
  36. $this->__phpunit_invocationMocker = null;
  37. }
  38. }
  39. }{epilogue}