Stub.php 910 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. /*
  3. * This file is part of the phpunit-mock-objects package.
  4. *
  5. * (c) Sebastian Bergmann <sebastian@phpunit.de>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace PHPUnit\Framework\MockObject;
  11. use PHPUnit\Framework\SelfDescribing;
  12. /**
  13. * An object that stubs the process of a normal method for a mock object.
  14. *
  15. * The stub object will replace the code for the stubbed method and return a
  16. * specific value instead of the original value.
  17. */
  18. interface Stub extends SelfDescribing
  19. {
  20. /**
  21. * Fakes the processing of the invocation $invocation by returning a
  22. * specific value.
  23. *
  24. * @param Invocation $invocation The invocation which was mocked and matched by the current method and argument matchers
  25. *
  26. * @return mixed
  27. */
  28. public function invoke(Invocation $invocation);
  29. }