Skip to content

Commit

Permalink
test: Add tests for getting headers and reason in Response class
Browse files Browse the repository at this point in the history
- Added test for getting headers in Response class
- Added test for getting reason in Response class
  • Loading branch information
guanguans committed Mar 22, 2024
1 parent 3e8fe74 commit 03d350f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/Foundation/ResponseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,16 @@
->header('Content-Type')->toBe('application/json');
})->group(__DIR__, __FILE__);

it('can get headers', function (): void {
expect(Response::fromPsrResponse(new \GuzzleHttp\Psr7\Response(200, ['Content-Type' => 'application/json'])))
->headers()->toBeArray();
})->group(__DIR__, __FILE__);

it('can get reason', function (): void {
expect(Response::fromPsrResponse(new \GuzzleHttp\Psr7\Response(200, ['Content-Type' => 'application/json'])))
->reason()->toBeString();
})->group(__DIR__, __FILE__);

it('can get effective uri', function (): void {
expect(Response::fromPsrResponse(new \GuzzleHttp\Psr7\Response(200, ['Content-Type' => 'application/json'])))
->effectiveUri()->toBeNull();
Expand Down

0 comments on commit 03d350f

Please sign in to comment.