trypost/tests/Feature/Ai/UserAiGenerationChannelTest.php

21 lines
591 B
PHP

<?php
declare(strict_types=1);
use App\Broadcasting\UserAiGenerationChannel;
use App\Models\User;
test('user can join their own generation channel', function () {
$user = User::factory()->create();
$channel = new UserAiGenerationChannel;
expect($channel->join($user, $user, 'some-uuid'))->toBeTrue();
});
test('user cannot join another users generation channel', function () {
$user = User::factory()->create();
$other = User::factory()->create();
$channel = new UserAiGenerationChannel;
expect($channel->join($user, $other, 'some-uuid'))->toBeFalse();
});