mirror of
https://github.com/HDInnovations/UNIT3D-Community-Edition.git
synced 2026-02-20 20:04:20 -06:00
109 lines
3.7 KiB
PHP
109 lines
3.7 KiB
PHP
<?php
|
|
|
|
uses(RefreshDatabase::class);
|
|
|
|
test('destroy returns an ok response', function (): void {
|
|
$this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.');
|
|
|
|
$playlistTorrent = \App\Models\PlaylistTorrent::factory()->create();
|
|
$user = \App\Models\User::factory()->create();
|
|
|
|
$response = $this->actingAs($user)->delete(route('playlist_torrents.destroy', [$playlistTorrent]));
|
|
|
|
$response->assertOk();
|
|
$this->assertModelMissing($playlistTorrent);
|
|
|
|
// TODO: perform additional assertions
|
|
});
|
|
|
|
test('destroy aborts with a 403', function (): void {
|
|
$this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.');
|
|
|
|
$playlistTorrent = \App\Models\PlaylistTorrent::factory()->create();
|
|
$user = \App\Models\User::factory()->create();
|
|
|
|
// TODO: perform additional setup to trigger `abort_unless(403)`...
|
|
|
|
$response = $this->actingAs($user)->delete(route('playlist_torrents.destroy', [$playlistTorrent]));
|
|
|
|
$response->assertForbidden();
|
|
});
|
|
|
|
test('massupsert validates with a form request', function (): void {
|
|
$this->assertActionUsesFormRequest(
|
|
\App\Http\Controllers\PlaylistTorrentController::class,
|
|
'massUpsert',
|
|
\App\Http\Requests\MassUpsertPlaylistTorrentRequest::class
|
|
);
|
|
});
|
|
|
|
test('mass upsert returns an ok response', function (): void {
|
|
$this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.');
|
|
|
|
$playlist = \App\Models\Playlist::factory()->create();
|
|
$user = \App\Models\User::factory()->create();
|
|
|
|
$response = $this->actingAs($user)->put(route('playlist_torrents.massUpsert'), [
|
|
// TODO: send request data
|
|
]);
|
|
|
|
$response->assertOk();
|
|
|
|
// TODO: perform additional assertions
|
|
});
|
|
|
|
test('mass upsert aborts with a 403', function (): void {
|
|
$this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.');
|
|
|
|
$playlist = \App\Models\Playlist::factory()->create();
|
|
$user = \App\Models\User::factory()->create();
|
|
|
|
// TODO: perform additional setup to trigger `abort_unless(403)`...
|
|
|
|
$response = $this->actingAs($user)->put(route('playlist_torrents.massUpsert'), [
|
|
// TODO: send request data
|
|
]);
|
|
|
|
$response->assertForbidden();
|
|
});
|
|
|
|
test('store validates with a form request', function (): void {
|
|
$this->assertActionUsesFormRequest(
|
|
\App\Http\Controllers\PlaylistTorrentController::class,
|
|
'store',
|
|
\App\Http\Requests\StorePlaylistTorrentRequest::class
|
|
);
|
|
});
|
|
|
|
test('store returns an ok response', function (): void {
|
|
$this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.');
|
|
|
|
$playlist = \App\Models\Playlist::factory()->create();
|
|
$user = \App\Models\User::factory()->create();
|
|
|
|
$response = $this->actingAs($user)->post(route('playlist_torrents.store'), [
|
|
// TODO: send request data
|
|
]);
|
|
|
|
$response->assertOk();
|
|
|
|
// TODO: perform additional assertions
|
|
});
|
|
|
|
test('store aborts with a 403', function (): void {
|
|
$this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.');
|
|
|
|
$playlist = \App\Models\Playlist::factory()->create();
|
|
$user = \App\Models\User::factory()->create();
|
|
|
|
// TODO: perform additional setup to trigger `abort_unless(403)`...
|
|
|
|
$response = $this->actingAs($user)->post(route('playlist_torrents.store'), [
|
|
// TODO: send request data
|
|
]);
|
|
|
|
$response->assertForbidden();
|
|
});
|
|
|
|
// test cases...
|