diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..6b72963 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,10 @@ +| Q | A +| ------------- | --- +| Bug fix? | yes/no +| New feature? | yes/no +| Fixed tickets | #... + + + diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..bb2e256 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,8 @@ +version: 2 +updates: + - package-ecosystem: "composer" + directory: "/" + schedule: + interval: "daily" + commit-message: + prefix: "chore(deps): " diff --git a/README.md b/README.md index 5df5d5b..caafa01 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,8 @@ Requires Slim Framework 4 and PHP 7.3 or newer. ## Usage ```php +use function Nekofar\Slim\Pest\get; + beforeEach(function (): void { $app = require __DIR__ . '/../config/bootstrap.php'; @@ -35,7 +37,6 @@ it('can see home page', function (): void { ->assertOk() ->assertSee('Welcome'); }); - ``` ## Contributing diff --git a/composer.json b/composer.json index 1254c1a..ea12a47 100644 --- a/composer.json +++ b/composer.json @@ -14,7 +14,7 @@ "license": "MIT", "require": { "php": "^7.3 || ^8.0", - "nekofar/slim-test": "^1.0@beta", + "nekofar/slim-test": "^1.0.2", "pestphp/pest": "^1.6", "pestphp/pest-plugin": "^1.0" }, diff --git a/tests/Functions.php b/tests/Functions.php index 1e702dd..c2ab709 100644 --- a/tests/Functions.php +++ b/tests/Functions.php @@ -59,51 +59,39 @@ }); it('can send a get request with json data and receive json in response', function (): void { - $response = getJson('/json') + getJson('/json') ->assertOk() - ->assertJson(); - - expect((string) $response->getBody())->json()->hello->toBe('world'); + ->assertJson(['hello' => 'world']); }); it('can send a post request with json data and receive json in response', function (): void { - $response = postJson('/json') + postJson('/json') ->assertOk() - ->assertJson(); - - expect((string) $response->getBody())->json()->hello->toBe('world'); + ->assertJson(['hello' => 'world']); }); it('can send a put request with json data and receive json in response', function (): void { - $response = putJson('/json') + putJson('/json') ->assertOk() - ->assertJson(); - - expect((string) $response->getBody())->json()->hello->toBe('world'); + ->assertJson(['hello' => 'world']); }); it('can send a patch request with json data and receive json in response', function (): void { - $response = patchJson('/json') + patchJson('/json') ->assertOk() - ->assertJson(); - - expect((string) $response->getBody())->json()->hello->toBe('world'); + ->assertJson(['hello' => 'world']); }); it('can send a delete request with json data and receive json in response', function (): void { - $response = deleteJson('/json') + deleteJson('/json') ->assertOk() - ->assertJson(); - - expect((string) $response->getBody())->json()->hello->toBe('world'); + ->assertJson(['hello' => 'world']); }); it('can send an options request with json data and receive json in response', function (): void { - $response = optionsJson('/json') + optionsJson('/json') ->assertOk() - ->assertJson(); - - expect((string) $response->getBody())->json()->hello->toBe('world'); + ->assertJson(['hello' => 'world']); }); it('can send a request and receive not found status in response', function (): void {