-
-
Notifications
You must be signed in to change notification settings - Fork 45
/
Copy pathClientTest.php
44 lines (37 loc) · 1.2 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
38
39
40
41
42
43
44
<?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\PushMe;
use Guanguans\Notify\PushMe\Authenticator;
use Guanguans\Notify\PushMe\Client;
use Guanguans\Notify\PushMe\Messages\Message;
it('can send message', function (): void {
$authenticator = new Authenticator(
'uhDXKk3UXJtdT3dE6',
// 'hLzPCm6Y1y26iddAy'
);
$client = new Client($authenticator);
$message = Message::make([
// 'push_key' => 'uhDXKk3UXJtdT3dE6',
// 'temp_key' => 'hLzPCm6Y1y26iddAy',
'title' => 'This is title.',
'content' => '> This is content.',
'date' => date('Y-m-d H:i:s'),
'type' => 'markdown',
]);
expect($client)
->mock([
response('success'),
response('请检查push_key是否正确'),
])
->assertCanSendMessage($message);
})->group(__DIR__, __FILE__);