From 0fbc1ad1835b658020e04a398e7d9d1d5ec3bc16 Mon Sep 17 00:00:00 2001 From: Michael Utz Date: Mon, 14 Nov 2022 22:17:48 +0300 Subject: [PATCH] Run `pest --init` --- phpunit.xml | 18 +++++++++++++++++ tests/ExampleTest.php | 5 +++++ tests/Pest.php | 45 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 68 insertions(+) create mode 100644 phpunit.xml create mode 100644 tests/ExampleTest.php create mode 100644 tests/Pest.php diff --git a/phpunit.xml b/phpunit.xml new file mode 100644 index 0000000..8f4b58c --- /dev/null +++ b/phpunit.xml @@ -0,0 +1,18 @@ + + + + + ./tests + + + + + ./app + ./src + + + diff --git a/tests/ExampleTest.php b/tests/ExampleTest.php new file mode 100644 index 0000000..61cd84c --- /dev/null +++ b/tests/ExampleTest.php @@ -0,0 +1,5 @@ +toBeTrue(); +}); diff --git a/tests/Pest.php b/tests/Pest.php new file mode 100644 index 0000000..5949c61 --- /dev/null +++ b/tests/Pest.php @@ -0,0 +1,45 @@ +in('Feature'); + +/* +|-------------------------------------------------------------------------- +| Expectations +|-------------------------------------------------------------------------- +| +| When you're writing tests, you often need to check that values meet certain conditions. The +| "expect()" function gives you access to a set of "expectations" methods that you can use +| to assert different things. Of course, you may extend the Expectation API at any time. +| +*/ + +expect()->extend('toBeOne', function () { + return $this->toBe(1); +}); + +/* +|-------------------------------------------------------------------------- +| Functions +|-------------------------------------------------------------------------- +| +| While Pest is very powerful out-of-the-box, you may have some testing code specific to your +| project that you don't want to repeat in every file. Here you can also expose helpers as +| global functions to help you to reduce the number of lines of code in your test files. +| +*/ + +function something() +{ + // .. +}