Files
UNIT3D/tests/Feature/Http/Controllers/API/TorrentControllerTest.shift.php
2023-07-11 18:27:15 +00:00

67 lines
2.0 KiB
PHP

<?php
uses(RefreshDatabase::class);
test('filter 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.');
$response = $this->getJson('api/torrents/filter');
$response->assertOk();
$response->assertJsonStructure([
// TODO: compare expected response data
]);
// TODO: perform additional assertions
});
test('index 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.');
$torrents = \App\Models\Torrent::factory()->times(3)->create();
$response = $this->getJson(route('api.torrents.index'));
$response->assertOk();
$response->assertJsonStructure([
// TODO: compare expected response data
]);
// TODO: perform additional assertions
});
test('show 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.');
$torrent = \App\Models\Torrent::factory()->create();
$response = $this->getJson('api/torrents/{id}');
$response->assertOk();
$response->assertJsonStructure([
// TODO: compare expected response data
]);
// TODO: perform additional assertions
});
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.');
$category = \App\Models\Category::factory()->create();
$user = \App\Models\User::factory()->create();
$response = $this->postJson('api/torrents/upload', [
// TODO: send request data
]);
$response->assertOk();
$response->assertJsonStructure([
// TODO: compare expected response data
]);
// TODO: perform additional assertions
});
// test cases...