Invokable.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  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. /**
  11. * Interface for classes which can be invoked.
  12. *
  13. * The invocation will be taken from a mock object and passed to an object
  14. * of this class.
  15. */
  16. interface PHPUnit_Framework_MockObject_Invokable extends PHPUnit_Framework_MockObject_Verifiable
  17. {
  18. /**
  19. * Invokes the invocation object $invocation so that it can be checked for
  20. * expectations or matched against stubs.
  21. *
  22. * @param PHPUnit_Framework_MockObject_Invocation $invocation The invocation object passed from mock object
  23. *
  24. * @return object
  25. */
  26. public function invoke(PHPUnit_Framework_MockObject_Invocation $invocation);
  27. /**
  28. * Checks if the invocation matches.
  29. *
  30. * @param PHPUnit_Framework_MockObject_Invocation $invocation The invocation object passed from mock object
  31. *
  32. * @return bool
  33. */
  34. public function matches(PHPUnit_Framework_MockObject_Invocation $invocation);
  35. }