koel/tests/Feature/SongVisibilityTest.php

24 lines
589 B
PHP
Raw Normal View History

2024-01-09 18:34:40 +00:00
<?php
namespace Tests\Feature;
use App\Models\Song;
use Tests\TestCase;
2024-01-11 12:41:33 +00:00
use function Tests\create_admin;
2024-01-09 18:34:40 +00:00
class SongVisibilityTest extends TestCase
{
public function testChangingVisibilityIsForbiddenInCommunityEdition(): void
{
2024-01-11 12:41:33 +00:00
$owner = create_admin();
2024-01-09 18:34:40 +00:00
Song::factory(3)->create();
$this->putAs('api/songs/make-public', ['songs' => Song::query()->pluck('id')->all()], $owner)
->assertForbidden();
$this->putAs('api/songs/make-private', ['songs' => Song::query()->pluck('id')->all()], $owner)
->assertForbidden();
}
}