|
18 | 18 | use Guanguans\Notify\IGot\Authenticator; |
19 | 19 | use Guanguans\Notify\IGot\Client; |
20 | 20 | use Guanguans\Notify\IGot\Messages\Message; |
21 | | -use Psr\Http\Message\ResponseInterface; |
22 | 21 |
|
23 | 22 | it('can send message', function (): void { |
24 | 23 | $authenticator = new Authenticator('5dcd2f91d38cc47447414'); |
25 | 24 | $client = new Client($authenticator); |
26 | 25 | $message = Message::make([ |
| 26 | + 'title' => 'This is title.', |
27 | 27 | '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 | + ], |
37 | 36 | ]); |
38 | 37 |
|
39 | 38 | expect($client) |
40 | 39 | ->mock([ |
41 | 40 | create_response('{"ret":0,"data":{"id":"65d31d11adda140033fc8c17"},"errMsg":"发送成功"}'), |
42 | 41 | create_response('{"ret":201,"data":{},"errMsg":"请使用系统分配的有效key"}'), |
43 | 42 | ]) |
44 | | - ->send($message)->toBeInstanceOf(ResponseInterface::class) |
45 | | - ->send($message)->toBeInstanceOf(ResponseInterface::class); |
| 43 | + ->assertCanSendMessage($message); |
46 | 44 | })->group(__DIR__, __FILE__); |
0 commit comments