Skip to content

Commit

Permalink
Merge branch 'release/v1.1.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
nekofar committed Sep 14, 2021
2 parents 0cf0f25 + 9796888 commit 3cda306
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 26 deletions.
10 changes: 10 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
| Q | A
| ------------- | ---
| Bug fix? | yes/no
| New feature? | yes/no
| Fixed tickets | #... <!-- #-prefixed issue number(s), if any -->

<!--
- Replace this comment by a description of what your PR is solving.
-->

8 changes: 8 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: 2
updates:
- package-ecosystem: "composer"
directory: "/"
schedule:
interval: "daily"
commit-message:
prefix: "chore(deps): "
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand All @@ -35,7 +37,6 @@ it('can see home page', function (): void {
->assertOk()
->assertSee('Welcome');
});

```

## Contributing
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
36 changes: 12 additions & 24 deletions tests/Functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 3cda306

Please sign in to comment.