index.rst 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. Mockery
  2. =======
  3. Mockery is a simple yet flexible PHP mock object framework for use in unit
  4. testing with PHPUnit, PHPSpec or any other testing framework. Its core goal is
  5. to offer a test double framework with a succinct API capable of clearly
  6. defining all possible object operations and interactions using a human
  7. readable Domain Specific Language (DSL). Designed as a drop in alternative to
  8. PHPUnit's phpunit-mock-objects library, Mockery is easy to integrate with
  9. PHPUnit and can operate alongside phpunit-mock-objects without the World
  10. ending.
  11. Mock Objects
  12. ------------
  13. In unit tests, mock objects simulate the behaviour of real objects. They are
  14. commonly utilised to offer test isolation, to stand in for objects which do
  15. not yet exist, or to allow for the exploratory design of class APIs without
  16. requiring actual implementation up front.
  17. The benefits of a mock object framework are to allow for the flexible
  18. generation of such mock objects (and stubs). They allow the setting of
  19. expected method calls and return values using a flexible API which is capable
  20. of capturing every possible real object behaviour in way that is stated as
  21. close as possible to a natural language description.
  22. Getting Started
  23. ---------------
  24. Ready to dive into the Mockery framework? Then you can get started by reading
  25. the "Getting Started" section!
  26. .. toctree::
  27. :hidden:
  28. getting_started/index
  29. .. include:: getting_started/map.rst.inc
  30. Reference
  31. ---------
  32. The reference contains a complete overview of all features of the Mockery
  33. framework.
  34. .. toctree::
  35. :hidden:
  36. reference/index
  37. .. include:: reference/map.rst.inc
  38. Mockery
  39. -------
  40. Learn about Mockery's configuration, reserved method names, exceptions...
  41. .. toctree::
  42. :hidden:
  43. mockery/index
  44. .. include:: mockery/map.rst.inc
  45. Cookbook
  46. --------
  47. Want to learn some easy tips and tricks? Take a look at the cookbook articles!
  48. .. toctree::
  49. :hidden:
  50. cookbook/index
  51. .. include:: cookbook/map.rst.inc