feat: web, webhook and telegram channel drivers
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BCrwHHnGCB5XH968Nxokqw
This commit is contained in:
23
core/tests/Unit/Channels/WebChannelTest.php
Normal file
23
core/tests/Unit/Channels/WebChannelTest.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Unit\Channels;
|
||||
|
||||
use App\Channels\WebChannel;
|
||||
use App\Enums\Presence;
|
||||
use App\Models\User;
|
||||
use Illuminate\Support\Facades\Cache;
|
||||
use Tests\TestCase;
|
||||
|
||||
class WebChannelTest extends TestCase
|
||||
{
|
||||
public function test_presence_follows_heartbeat(): void
|
||||
{
|
||||
$user = new User(['login' => 'n', 'tz' => 'UTC']);
|
||||
$user->id = 7;
|
||||
$driver = new WebChannel;
|
||||
|
||||
$this->assertSame(Presence::Absent, $driver->presence($user, []));
|
||||
Cache::put('heartbeat:7', true, 90);
|
||||
$this->assertSame(Presence::Present, $driver->presence($user, []));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user