mirror of
https://github.com/BillyOutlast/UNIT3D.git
synced 2026-02-04 19:21:21 +01:00
307 lines
9.9 KiB
PHP
307 lines
9.9 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
/**
|
|
* NOTICE OF LICENSE.
|
|
*
|
|
* UNIT3D Community Edition is open-sourced software licensed under the GNU Affero General Public License v3.0
|
|
* The details is bundled with this project in the file LICENSE.txt.
|
|
*
|
|
* @project UNIT3D Community Edition
|
|
*
|
|
* @author HDVinnie <hdinnovations@protonmail.com>
|
|
* @license https://www.gnu.org/licenses/agpl-3.0.en.html/ GNU Affero General Public License v3.0
|
|
*/
|
|
|
|
use App\Models\Bot;
|
|
use App\Models\User;
|
|
use App\Models\UserAudible;
|
|
use App\Models\UserEcho;
|
|
|
|
test('audibles 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.');
|
|
|
|
$user = User::factory()->create();
|
|
$authUser = User::factory()->create();
|
|
|
|
$response = $this->actingAs($authUser)->get('api/chat/audibles');
|
|
|
|
$response->assertOk();
|
|
|
|
// TODO: perform additional assertions
|
|
});
|
|
|
|
test('bot messages 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.');
|
|
|
|
$bot = Bot::factory()->create();
|
|
$user = User::factory()->create();
|
|
|
|
$response = $this->actingAs($user)->get('api/chat/bot/{bot_id}');
|
|
|
|
$response->assertOk();
|
|
|
|
// TODO: perform additional assertions
|
|
});
|
|
|
|
test('bots 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.');
|
|
|
|
$user = User::factory()->create();
|
|
|
|
$response = $this->actingAs($user)->get('api/chat/bots');
|
|
|
|
$response->assertOk();
|
|
|
|
// TODO: perform additional assertions
|
|
});
|
|
|
|
test('config 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.');
|
|
|
|
$user = User::factory()->create();
|
|
|
|
$response = $this->actingAs($user)->get('api/chat/config');
|
|
|
|
$response->assertOk();
|
|
|
|
// TODO: perform additional assertions
|
|
});
|
|
|
|
test('create message 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.');
|
|
|
|
$bots = Bot::factory()->times(3)->create();
|
|
$userEchos = UserEcho::factory()->times(3)->create();
|
|
$userAudibles = UserAudible::factory()->times(3)->create();
|
|
$user = User::factory()->create();
|
|
|
|
$response = $this->actingAs($user)->post('api/chat/messages', [
|
|
// TODO: send request data
|
|
]);
|
|
|
|
$response->assertOk();
|
|
|
|
// TODO: perform additional assertions
|
|
});
|
|
|
|
test('delete bot echo 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.');
|
|
|
|
$user = User::factory()->create();
|
|
$userEchos = UserEcho::factory()->times(3)->create();
|
|
$authUser = User::factory()->create();
|
|
|
|
$response = $this->actingAs($authUser)->post('api/chat/echoes/{user_id}/delete/bot', [
|
|
// TODO: send request data
|
|
]);
|
|
|
|
$response->assertOk();
|
|
|
|
// TODO: perform additional assertions
|
|
});
|
|
|
|
test('delete message 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.');
|
|
|
|
$user = User::factory()->create();
|
|
|
|
$response = $this->actingAs($user)->post('api/chat/message/{id}/delete', [
|
|
// TODO: send request data
|
|
]);
|
|
|
|
$response->assertOk();
|
|
|
|
// TODO: perform additional assertions
|
|
});
|
|
|
|
test('delete room echo 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.');
|
|
|
|
$user = User::factory()->create();
|
|
$userEchos = UserEcho::factory()->times(3)->create();
|
|
$authUser = User::factory()->create();
|
|
|
|
$response = $this->actingAs($authUser)->post('api/chat/echoes/{user_id}/delete/chatroom', [
|
|
// TODO: send request data
|
|
]);
|
|
|
|
$response->assertOk();
|
|
|
|
// TODO: perform additional assertions
|
|
});
|
|
|
|
test('delete target echo 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.');
|
|
|
|
$user = User::factory()->create();
|
|
$userEchos = UserEcho::factory()->times(3)->create();
|
|
$authUser = User::factory()->create();
|
|
|
|
$response = $this->actingAs($authUser)->post('api/chat/echoes/{user_id}/delete/target', [
|
|
// TODO: send request data
|
|
]);
|
|
|
|
$response->assertOk();
|
|
|
|
// TODO: perform additional assertions
|
|
});
|
|
|
|
test('echoes 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.');
|
|
|
|
$user = User::factory()->create();
|
|
$authUser = User::factory()->create();
|
|
|
|
$response = $this->actingAs($authUser)->get('api/chat/echoes');
|
|
|
|
$response->assertOk();
|
|
|
|
// TODO: perform additional assertions
|
|
});
|
|
|
|
test('messages 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.');
|
|
|
|
$user = User::factory()->create();
|
|
|
|
$response = $this->actingAs($user)->get('api/chat/messages/{room_id}');
|
|
|
|
$response->assertOk();
|
|
|
|
// TODO: perform additional assertions
|
|
});
|
|
|
|
test('private messages 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.');
|
|
|
|
$user = User::factory()->create();
|
|
|
|
$response = $this->actingAs($user)->get('api/chat/private/messages/{target_id}');
|
|
|
|
$response->assertOk();
|
|
|
|
// TODO: perform additional assertions
|
|
});
|
|
|
|
test('rooms 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.');
|
|
|
|
$user = User::factory()->create();
|
|
|
|
$response = $this->actingAs($user)->get('api/chat/rooms');
|
|
|
|
$response->assertOk();
|
|
|
|
// TODO: perform additional assertions
|
|
});
|
|
|
|
test('statuses 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.');
|
|
|
|
$user = User::factory()->create();
|
|
|
|
$response = $this->actingAs($user)->get('api/chat/statuses');
|
|
|
|
$response->assertOk();
|
|
|
|
// TODO: perform additional assertions
|
|
});
|
|
|
|
test('toggle bot audible 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.');
|
|
|
|
$user = User::factory()->create();
|
|
$userAudibles = UserAudible::factory()->times(3)->create();
|
|
$authUser = User::factory()->create();
|
|
|
|
$response = $this->actingAs($authUser)->post('api/chat/audibles/{user_id}/toggle/bot', [
|
|
// TODO: send request data
|
|
]);
|
|
|
|
$response->assertOk();
|
|
|
|
// TODO: perform additional assertions
|
|
});
|
|
|
|
test('toggle room audible 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.');
|
|
|
|
$user = User::factory()->create();
|
|
$userAudibles = UserAudible::factory()->times(3)->create();
|
|
$authUser = User::factory()->create();
|
|
|
|
$response = $this->actingAs($authUser)->post('api/chat/audibles/{user_id}/toggle/chatroom', [
|
|
// TODO: send request data
|
|
]);
|
|
|
|
$response->assertOk();
|
|
|
|
// TODO: perform additional assertions
|
|
});
|
|
|
|
test('toggle target audible 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.');
|
|
|
|
$user = User::factory()->create();
|
|
$userAudibles = UserAudible::factory()->times(3)->create();
|
|
$authUser = User::factory()->create();
|
|
|
|
$response = $this->actingAs($authUser)->post('api/chat/audibles/{user_id}/toggle/target', [
|
|
// TODO: send request data
|
|
]);
|
|
|
|
$response->assertOk();
|
|
|
|
// TODO: perform additional assertions
|
|
});
|
|
|
|
test('update user chat status 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.');
|
|
|
|
$user = User::factory()->create();
|
|
$authUser = User::factory()->create();
|
|
|
|
$response = $this->actingAs($authUser)->post('api/chat/user/{id}/status', [
|
|
// TODO: send request data
|
|
]);
|
|
|
|
$response->assertOk();
|
|
|
|
// TODO: perform additional assertions
|
|
});
|
|
|
|
test('update user room 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.');
|
|
|
|
$user = User::factory()->create();
|
|
$userEchos = UserEcho::factory()->times(3)->create();
|
|
$authUser = User::factory()->create();
|
|
|
|
$response = $this->actingAs($authUser)->post('api/chat/user/{id}/chatroom', [
|
|
// TODO: send request data
|
|
]);
|
|
|
|
$response->assertOk();
|
|
|
|
// TODO: perform additional assertions
|
|
});
|
|
|
|
test('update user target 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.');
|
|
|
|
$user = User::factory()->create();
|
|
$authUser = User::factory()->create();
|
|
|
|
$response = $this->actingAs($authUser)->post('api/chat/user/{id}/target', [
|
|
// TODO: send request data
|
|
]);
|
|
|
|
$response->assertOk();
|
|
|
|
// TODO: perform additional assertions
|
|
});
|
|
|
|
// test cases...
|