Skip to content

Commit d4067a3

Browse files
committed
feat(IGot): Add title, url, copy, and detail to message
- Added 'title', 'url', 'automaticallyCopy', 'urgent', 'copy', and 'detail' fields to the message object - Updated the message content and structure - Improved message sending functionality
1 parent 16b6e44 commit d4067a3

1 file changed

Lines changed: 10 additions & 12 deletions

File tree

tests/IGot/ClientTest.php

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,29 +18,27 @@
1818
use Guanguans\Notify\IGot\Authenticator;
1919
use Guanguans\Notify\IGot\Client;
2020
use Guanguans\Notify\IGot\Messages\Message;
21-
use Psr\Http\Message\ResponseInterface;
2221

2322
it('can send message', function (): void {
2423
$authenticator = new Authenticator('5dcd2f91d38cc47447414');
2524
$client = new Client($authenticator);
2625
$message = Message::make([
26+
'title' => 'This is title.',
2727
'content' => 'This is content.',
28-
// 'title' => 'This is title.',
29-
// 'url' => 'https://www.github.com/guanguans/notify',
30-
// 'automaticallyCopy' => 1,
31-
// 'urgent' => 1,
32-
// 'copy' => 'This is copy.',
33-
// 'detail' => [
34-
// 'title' => 'This is detail title.',
35-
// 'content' => 'This is detail content.',
36-
// ],
28+
'url' => 'https://www.github.com/guanguans/notify',
29+
'automaticallyCopy' => 1,
30+
'urgent' => 1,
31+
'copy' => 'This is copy.',
32+
'detail' => [
33+
'foo' => 'This is detail foo.',
34+
'bar' => 'This is detail bar.',
35+
],
3736
]);
3837

3938
expect($client)
4039
->mock([
4140
create_response('{"ret":0,"data":{"id":"65d31d11adda140033fc8c17"},"errMsg":"发送成功"}'),
4241
create_response('{"ret":201,"data":{},"errMsg":"请使用系统分配的有效key"}'),
4342
])
44-
->send($message)->toBeInstanceOf(ResponseInterface::class)
45-
->send($message)->toBeInstanceOf(ResponseInterface::class);
43+
->assertCanSendMessage($message);
4644
})->group(__DIR__, __FILE__);

0 commit comments

Comments
 (0)