diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Feature/ExampleTest.php | 7 | ||||
-rw-r--r-- | tests/Pest.php | 47 | ||||
-rw-r--r-- | tests/TestCase.php | 10 | ||||
-rw-r--r-- | tests/Unit/ExampleTest.php | 5 |
4 files changed, 69 insertions, 0 deletions
diff --git a/tests/Feature/ExampleTest.php b/tests/Feature/ExampleTest.php new file mode 100644 index 0000000..8b5843f --- /dev/null +++ b/tests/Feature/ExampleTest.php @@ -0,0 +1,7 @@ +<?php + +it('returns a successful response', function () { + $response = $this->get('/'); + + $response->assertStatus(200); +}); diff --git a/tests/Pest.php b/tests/Pest.php new file mode 100644 index 0000000..60f04a4 --- /dev/null +++ b/tests/Pest.php @@ -0,0 +1,47 @@ +<?php + +/* +|-------------------------------------------------------------------------- +| Test Case +|-------------------------------------------------------------------------- +| +| The closure you provide to your test functions is always bound to a specific PHPUnit test +| case class. By default, that class is "PHPUnit\Framework\TestCase". Of course, you may +| need to change it using the "pest()" function to bind a different classes or traits. +| +*/ + +pest()->extend(Tests\TestCase::class) + // ->use(Illuminate\Foundation\Testing\RefreshDatabase::class) + ->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() +{ + // .. +} diff --git a/tests/TestCase.php b/tests/TestCase.php new file mode 100644 index 0000000..fe1ffc2 --- /dev/null +++ b/tests/TestCase.php @@ -0,0 +1,10 @@ +<?php + +namespace Tests; + +use Illuminate\Foundation\Testing\TestCase as BaseTestCase; + +abstract class TestCase extends BaseTestCase +{ + // +} diff --git a/tests/Unit/ExampleTest.php b/tests/Unit/ExampleTest.php new file mode 100644 index 0000000..44a4f33 --- /dev/null +++ b/tests/Unit/ExampleTest.php @@ -0,0 +1,5 @@ +<?php + +test('that true is true', function () { + expect(true)->toBeTrue(); +}); |