-
-
Notifications
You must be signed in to change notification settings - Fork 46
/
ClientTest.php
36 lines (29 loc) · 990 Bytes
/
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
<?php
/** @noinspection StaticClosureCanBeUsedInspection */
/** @noinspection PhpUnhandledExceptionInspection */
declare(strict_types=1);
/**
* Copyright (c) 2021-2024 guanguans<ityaozm@gmail.com>
*
* 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\Bark;
use Guanguans\Notify\GoogleChat\Authenticator;
use Guanguans\Notify\GoogleChat\Client;
use Guanguans\Notify\GoogleChat\Messages\Message;
use function Pest\Faker\faker;
it('can send message', function (): void {
$authenticator = new Authenticator('spaceId', 'key', 'token', 'threadKey');
$client = new Client($authenticator);
$message = Message::make([
'text' => 'This is text.',
]);
expect($client)
->mock([
response(faker()->text()),
])
->assertCanSendMessage($message);
})->group(__DIR__, __FILE__);