MockObject.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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. use PHPUnit\Framework\ExpectationFailedException;
  11. use PHPUnit\Framework\MockObject\Builder\InvocationMocker;
  12. use PHPUnit\Framework\MockObject\Matcher\Invocation;
  13. /**
  14. * Interface for all mock objects which are generated by
  15. * MockBuilder.
  16. *
  17. * @method InvocationMocker method($constraint)
  18. */
  19. interface PHPUnit_Framework_MockObject_MockObject /*extends Verifiable*/
  20. {
  21. /**
  22. * Registers a new expectation in the mock object and returns the match
  23. * object which can be infused with further details.
  24. *
  25. * @param Invocation $matcher
  26. *
  27. * @return InvocationMocker
  28. */
  29. public function expects(Invocation $matcher);
  30. /**
  31. * @return InvocationMocker
  32. */
  33. public function __phpunit_setOriginalObject($originalObject);
  34. /**
  35. * @return InvocationMocker
  36. */
  37. public function __phpunit_getInvocationMocker();
  38. /**
  39. * Verifies that the current expectation is valid. If everything is OK the
  40. * code should just return, if not it must throw an exception.
  41. *
  42. * @throws ExpectationFailedException
  43. */
  44. public function __phpunit_verify();
  45. /**
  46. * @return bool
  47. */
  48. public function __phpunit_hasMatchers();
  49. }