Pest.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. /*
  3. |--------------------------------------------------------------------------
  4. | Test Case
  5. |--------------------------------------------------------------------------
  6. |
  7. | The closure you provide to your test functions is always bound to a specific PHPUnit test
  8. | case class. By default, that class is "PHPUnit\Framework\TestCase". Of course, you may
  9. | need to change it using the "uses()" function to bind a different classes or traits.
  10. |
  11. */
  12. // uses(Tests\TestCase::class)->in('Feature');
  13. /*
  14. |--------------------------------------------------------------------------
  15. | Expectations
  16. |--------------------------------------------------------------------------
  17. |
  18. | When you're writing tests, you often need to check that values meet certain conditions. The
  19. | "expect()" function gives you access to a set of "expectations" methods that you can use
  20. | to assert different things. Of course, you may extend the Expectation API at any time.
  21. |
  22. */
  23. expect()->extend('toBeOne', function () {
  24. return $this->toBe(1);
  25. });
  26. /*
  27. |--------------------------------------------------------------------------
  28. | Functions
  29. |--------------------------------------------------------------------------
  30. |
  31. | While Pest is very powerful out-of-the-box, you may have some testing code specific to your
  32. | project that you don't want to repeat in every file. Here you can also expose helpers as
  33. | global functions to help you to reduce the number of lines of code in your test files.
  34. |
  35. */
  36. function something()
  37. {
  38. // ..
  39. }