-
-
Notifications
You must be signed in to change notification settings - Fork 45
/
ClientTest.php
37 lines (30 loc) · 1.11 KB
/
ClientTest.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php
/** @noinspection StaticClosureCanBeUsedInspection */
/** @noinspection PhpUnhandledExceptionInspection */
declare(strict_types=1);
/**
* Copyright (c) 2021-2025 guanguans<[email protected]>
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*
* @see https://github.com/guanguans/notify
*/
namespace Guanguans\NotifyTests\ShowdocPush;
use Guanguans\Notify\ShowdocPush\Authenticator;
use Guanguans\Notify\ShowdocPush\Client;
use Guanguans\Notify\ShowdocPush\Messages\Message;
it('can send message', function (): void {
$authenticator = new Authenticator('f096edb95f92540219a41e47060eeb6d946199');
$client = new Client($authenticator);
$message = Message::make([
'title' => 'This is title.',
'content' => 'This is content.',
]);
expect($client)
->mock([
response('{"error_code":0,"error_message":"ok"}'),
response('{"error_code":10103,"error_message":"url\u6216token\u4e0d\u6b63\u786e"}'),
])
->assertCanSendMessage($message);
})->group(__DIR__, __FILE__);