koel/tests/Feature/SongVisibilityTest.php

24 lines
584 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();
2024-01-16 21:14:14 +00:00
$this->putAs('api/songs/publicize', ['songs' => Song::query()->pluck('id')->all()], $owner)
2024-01-09 18:34:40 +00:00
->assertForbidden();
2024-01-16 21:14:14 +00:00
$this->putAs('api/songs/privatize', ['songs' => Song::query()->pluck('id')->all()], $owner)
2024-01-09 18:34:40 +00:00
->assertForbidden();
}
}