Skip to content

Commit

Permalink
test(test): add tests for form params, query, and Multipart conversion
Browse files Browse the repository at this point in the history
- Added tests for converting message to form params, query, and Multipart
- Ensured conversion methods return the expected types
  • Loading branch information
guanguans committed Jun 14, 2024
1 parent 87368a6 commit bf9a95c
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tests/Foundation/MessageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,28 @@

use Guanguans\Notify\Foundation\Concerns\AsNullUri;
use Guanguans\Notify\Foundation\Message;
use GuzzleHttp\Psr7\MultipartStream;

it('can dump debug info', function (): void {
expect(new class extends Message {
use AsNullUri;
})->dump()->toBeInstanceOf(Message::class);
})->group(__DIR__, __FILE__);

it('can to form params', function (): void {
expect((fn (): string => $this->toFormParams())->call(new class extends Message {
use AsNullUri;
}))->toBeString();
})->group(__DIR__, __FILE__);

it('can to query', function (): void {
expect((fn (): string => $this->toQuery())->call(new class extends Message {
use AsNullUri;
}))->toBeString();
})->group(__DIR__, __FILE__);

it('can to Multipart', function (): void {
expect((fn (): MultipartStream => $this->toMultiPart())->call(new class extends Message {
use AsNullUri;
}))->toBeInstanceOf(MultipartStream::class);
})->group(__DIR__, __FILE__);

0 comments on commit bf9a95c

Please sign in to comment.