mirror of
https://github.com/BillyOutlast/UNIT3D.git
synced 2026-02-04 03:01:20 +01:00
update: test suite
This commit is contained in:
2
.github/workflows/phpunit-test.yml
vendored
2
.github/workflows/phpunit-test.yml
vendored
@@ -56,7 +56,7 @@ jobs:
|
||||
- name: Clear Application Cache
|
||||
run: php artisan optimize:clear
|
||||
- name: Run PHPUnit Tests
|
||||
run: ./vendor/bin/pest --coverage
|
||||
run: ./vendor/bin/pest --compact --coverage
|
||||
env:
|
||||
DB_CONNECTION: mysql
|
||||
DB_PORT: ${{ job.services.mysql.ports['3306'] }}
|
||||
|
||||
@@ -33,7 +33,7 @@ class MassUpsertPlaylistTorrentRequest extends FormRequest
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*/
|
||||
public function rules(Request $request): array
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'playlist_id' => [
|
||||
|
||||
@@ -13,8 +13,8 @@
|
||||
|
||||
namespace App\Http\Requests\Staff;
|
||||
|
||||
use App\Models\Region;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Validation\Rule;
|
||||
|
||||
class DestroyRegionRequest extends FormRequest
|
||||
@@ -22,12 +22,12 @@ class DestroyRegionRequest extends FormRequest
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*/
|
||||
public function rules(Request $request): array
|
||||
public function rules(Region $region): array
|
||||
{
|
||||
return [
|
||||
'region_id' => [
|
||||
'required',
|
||||
Rule::exists('regions', 'id')->whereNot('id', $request->route('region')->id),
|
||||
Rule::exists('regions', 'id')->whereNot('id', $region->id),
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ class StoreRequestFillRequest extends FormRequest
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*/
|
||||
public function rules(Request $request): array
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'torrent_id' => [
|
||||
|
||||
@@ -30,7 +30,7 @@ class StoreSubtitleRequest extends FormRequest
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*/
|
||||
public function rules(Request $request): array
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'subtitle_file' => [
|
||||
|
||||
@@ -30,7 +30,7 @@ class StoreTicketRequest extends FormRequest
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*/
|
||||
public function rules(Request $request): array
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'category_id' => [
|
||||
|
||||
@@ -33,7 +33,7 @@ class UpdatePlaylistRequest extends FormRequest
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*/
|
||||
public function rules(Request $request): array
|
||||
public function rules(): array
|
||||
{
|
||||
$this->sanitize();
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ class UpdateSubtitleRequest extends FormRequest
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*/
|
||||
public function rules(Request $request): array
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'language_id' => [
|
||||
|
||||
@@ -19,9 +19,8 @@
|
||||
<env name="REDIS_HOST" value="127.0.0.1" />
|
||||
<env name="REDIS_PORT" value="6379" />
|
||||
-->
|
||||
<env name="DB_DATABASE" value=":memory:"/>
|
||||
<env name="TELESCOPE_ENABLED" value="false"/>
|
||||
</php>
|
||||
<env name="TELESCOPE_ENABLED" value="false"/>
|
||||
</php>
|
||||
<coverage/>
|
||||
<source>
|
||||
<include>
|
||||
|
||||
@@ -1,4 +1,15 @@
|
||||
<?php
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see \App\Console\Commands\AutoBanDisposableUsers
|
||||
|
||||
@@ -1,4 +1,15 @@
|
||||
<?php
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see \App\Console\Commands\AutoBonAllocation
|
||||
|
||||
@@ -1,4 +1,15 @@
|
||||
<?php
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see \App\Console\Commands\AutoCorrectHistory
|
||||
|
||||
@@ -1,4 +1,15 @@
|
||||
<?php
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see \App\Console\Commands\AutoDeactivateWarning
|
||||
|
||||
@@ -1,4 +1,15 @@
|
||||
<?php
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see \App\Console\Commands\AutoDisableInactiveUsers
|
||||
|
||||
@@ -1,4 +1,15 @@
|
||||
<?php
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see \App\Console\Commands\AutoFlushPeers
|
||||
|
||||
@@ -1,4 +1,15 @@
|
||||
<?php
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see \App\Console\Commands\AutoGraveyard
|
||||
|
||||
@@ -1,4 +1,15 @@
|
||||
<?php
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see \App\Console\Commands\AutoGroup
|
||||
|
||||
@@ -1,4 +1,15 @@
|
||||
<?php
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see \App\Console\Commands\AutoHighspeedTag
|
||||
|
||||
@@ -1,4 +1,15 @@
|
||||
<?php
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see \App\Console\Commands\AutoNerdStat
|
||||
|
||||
@@ -1,4 +1,15 @@
|
||||
<?php
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see \App\Console\Commands\AutoPreWarning
|
||||
|
||||
@@ -1,4 +1,15 @@
|
||||
<?php
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see \App\Console\Commands\AutoRecycleAudits
|
||||
|
||||
@@ -1,4 +1,15 @@
|
||||
<?php
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see \App\Console\Commands\AutoRecycleClaimedTorrentRequests
|
||||
|
||||
@@ -1,4 +1,15 @@
|
||||
<?php
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see \App\Console\Commands\AutoRecycleFailedLogins
|
||||
|
||||
@@ -1,4 +1,15 @@
|
||||
<?php
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see \App\Console\Commands\AutoRecycleInvites
|
||||
|
||||
@@ -1,4 +1,15 @@
|
||||
<?php
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see \App\Console\Commands\AutoRefundDownload
|
||||
|
||||
@@ -1,4 +1,15 @@
|
||||
<?php
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see \App\Console\Commands\AutoRemoveFeaturedTorrent
|
||||
|
||||
@@ -1,4 +1,15 @@
|
||||
<?php
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see \App\Console\Commands\AutoRemovePersonalFreeleech
|
||||
|
||||
@@ -1,4 +1,15 @@
|
||||
<?php
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see \App\Console\Commands\AutoRemoveTimedTorrentBuffs
|
||||
|
||||
@@ -1,4 +1,15 @@
|
||||
<?php
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see \App\Console\Commands\AutoResetUserFlushes
|
||||
|
||||
@@ -1,4 +1,15 @@
|
||||
<?php
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see \App\Console\Commands\AutoSoftDeleteDisabledUsers
|
||||
|
||||
@@ -1,4 +1,15 @@
|
||||
<?php
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see \App\Console\Commands\AutoStatsClients
|
||||
|
||||
@@ -1,4 +1,15 @@
|
||||
<?php
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see \App\Console\Commands\AutoTorrentBalance
|
||||
|
||||
@@ -1,4 +1,15 @@
|
||||
<?php
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see \App\Console\Commands\AutoWarning
|
||||
|
||||
@@ -1,4 +1,15 @@
|
||||
<?php
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see \App\Console\Commands\CheckForStaleTickets
|
||||
|
||||
@@ -1,4 +1,15 @@
|
||||
<?php
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see \App\Console\Commands\ClearCache
|
||||
|
||||
@@ -1,4 +1,15 @@
|
||||
<?php
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see \App\Console\Commands\DbDump
|
||||
|
||||
@@ -1,4 +1,15 @@
|
||||
<?php
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see \App\Console\Commands\DbLoad
|
||||
|
||||
@@ -1,4 +1,15 @@
|
||||
<?php
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see \App\Console\Commands\EmailBlacklistUpdate
|
||||
|
||||
@@ -1,4 +1,15 @@
|
||||
<?php
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see \App\Console\Commands\FetchReleaseYears
|
||||
|
||||
@@ -1,4 +1,15 @@
|
||||
<?php
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see \App\Console\Commands\GitUpdater
|
||||
|
||||
@@ -1,4 +1,15 @@
|
||||
<?php
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see \App\Console\Commands\SetCache
|
||||
|
||||
@@ -1,4 +1,15 @@
|
||||
<?php
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see \App\Console\Commands\SyncPeers
|
||||
|
||||
@@ -1,4 +1,15 @@
|
||||
<?php
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see \App\Console\Commands\SyncTorrentSeasonEpisode
|
||||
|
||||
@@ -1,4 +1,15 @@
|
||||
<?php
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see \App\Console\Commands\TestMailSettings
|
||||
|
||||
@@ -1,4 +1,15 @@
|
||||
<?php
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see \App\Console\Commands\VendorCleanup
|
||||
|
||||
@@ -1,12 +1,26 @@
|
||||
<?php
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
|
||||
uses(RefreshDatabase::class);
|
||||
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 = \App\Models\User::factory()->create();
|
||||
$authUser = \App\Models\User::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
$authUser = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($authUser)->get('api/chat/audibles');
|
||||
|
||||
@@ -18,8 +32,8 @@ test('audibles returns an ok response', function (): void {
|
||||
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 = \App\Models\Bot::factory()->create();
|
||||
$user = \App\Models\User::factory()->create();
|
||||
$bot = Bot::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->get('api/chat/bot/{bot_id}');
|
||||
|
||||
@@ -31,7 +45,7 @@ test('bot messages returns an ok response', function (): void {
|
||||
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 = \App\Models\User::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->get('api/chat/bots');
|
||||
|
||||
@@ -43,7 +57,7 @@ test('bots returns an ok response', function (): void {
|
||||
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 = \App\Models\User::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->get('api/chat/config');
|
||||
|
||||
@@ -55,10 +69,10 @@ test('config returns an ok response', function (): void {
|
||||
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 = \App\Models\Bot::factory()->times(3)->create();
|
||||
$userEchos = \App\Models\UserEcho::factory()->times(3)->create();
|
||||
$userAudibles = \App\Models\UserAudible::factory()->times(3)->create();
|
||||
$user = \App\Models\User::factory()->create();
|
||||
$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
|
||||
@@ -72,9 +86,9 @@ test('create message returns an ok response', function (): void {
|
||||
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 = \App\Models\User::factory()->create();
|
||||
$userEchos = \App\Models\UserEcho::factory()->times(3)->create();
|
||||
$authUser = \App\Models\User::factory()->create();
|
||||
$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
|
||||
@@ -88,7 +102,7 @@ test('delete bot echo returns an ok response', function (): void {
|
||||
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 = \App\Models\User::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->post('api/chat/message/{id}/delete', [
|
||||
// TODO: send request data
|
||||
@@ -102,9 +116,9 @@ test('delete message returns an ok response', function (): void {
|
||||
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 = \App\Models\User::factory()->create();
|
||||
$userEchos = \App\Models\UserEcho::factory()->times(3)->create();
|
||||
$authUser = \App\Models\User::factory()->create();
|
||||
$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
|
||||
@@ -118,9 +132,9 @@ test('delete room echo returns an ok response', function (): void {
|
||||
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 = \App\Models\User::factory()->create();
|
||||
$userEchos = \App\Models\UserEcho::factory()->times(3)->create();
|
||||
$authUser = \App\Models\User::factory()->create();
|
||||
$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
|
||||
@@ -134,8 +148,8 @@ test('delete target echo returns an ok response', function (): void {
|
||||
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 = \App\Models\User::factory()->create();
|
||||
$authUser = \App\Models\User::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
$authUser = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($authUser)->get('api/chat/echoes');
|
||||
|
||||
@@ -147,7 +161,7 @@ test('echoes returns an ok response', function (): void {
|
||||
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 = \App\Models\User::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->get('api/chat/messages/{room_id}');
|
||||
|
||||
@@ -159,7 +173,7 @@ test('messages returns an ok response', function (): void {
|
||||
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 = \App\Models\User::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->get('api/chat/private/messages/{target_id}');
|
||||
|
||||
@@ -171,7 +185,7 @@ test('private messages returns an ok response', function (): void {
|
||||
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 = \App\Models\User::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->get('api/chat/rooms');
|
||||
|
||||
@@ -183,7 +197,7 @@ test('rooms returns an ok response', function (): void {
|
||||
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 = \App\Models\User::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->get('api/chat/statuses');
|
||||
|
||||
@@ -195,9 +209,9 @@ test('statuses returns an ok response', function (): void {
|
||||
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 = \App\Models\User::factory()->create();
|
||||
$userAudibles = \App\Models\UserAudible::factory()->times(3)->create();
|
||||
$authUser = \App\Models\User::factory()->create();
|
||||
$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
|
||||
@@ -211,9 +225,9 @@ test('toggle bot audible returns an ok response', function (): void {
|
||||
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 = \App\Models\User::factory()->create();
|
||||
$userAudibles = \App\Models\UserAudible::factory()->times(3)->create();
|
||||
$authUser = \App\Models\User::factory()->create();
|
||||
$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
|
||||
@@ -227,9 +241,9 @@ test('toggle room audible returns an ok response', function (): void {
|
||||
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 = \App\Models\User::factory()->create();
|
||||
$userAudibles = \App\Models\UserAudible::factory()->times(3)->create();
|
||||
$authUser = \App\Models\User::factory()->create();
|
||||
$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
|
||||
@@ -243,8 +257,8 @@ test('toggle target audible returns an ok response', function (): void {
|
||||
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 = \App\Models\User::factory()->create();
|
||||
$authUser = \App\Models\User::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
$authUser = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($authUser)->post('api/chat/user/{id}/status', [
|
||||
// TODO: send request data
|
||||
@@ -258,9 +272,9 @@ test('update user chat status returns an ok response', function (): void {
|
||||
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 = \App\Models\User::factory()->create();
|
||||
$userEchos = \App\Models\UserEcho::factory()->times(3)->create();
|
||||
$authUser = \App\Models\User::factory()->create();
|
||||
$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
|
||||
@@ -274,8 +288,8 @@ test('update user room returns an ok response', function (): void {
|
||||
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 = \App\Models\User::factory()->create();
|
||||
$authUser = \App\Models\User::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
$authUser = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($authUser)->post('api/chat/user/{id}/target', [
|
||||
// TODO: send request data
|
||||
|
||||
@@ -1,142 +1,78 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Feature\Http\Controllers\API;
|
||||
|
||||
use PHPUnit\Framework\Attributes\Test;
|
||||
use App\Models\Category;
|
||||
use App\Models\Resolution;
|
||||
use App\Models\Torrent;
|
||||
use App\Models\Type;
|
||||
use App\Models\User;
|
||||
use Database\Seeders\BotsTableSeeder;
|
||||
use Database\Seeders\ChatroomTableSeeder;
|
||||
use Database\Seeders\UsersTableSeeder;
|
||||
use Illuminate\Http\UploadedFile;
|
||||
use Tests\TestCase;
|
||||
|
||||
/**
|
||||
* @see \App\Http\Controllers\API\TorrentController
|
||||
* 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
|
||||
*/
|
||||
final class TorrentControllerTest extends TestCase
|
||||
{
|
||||
#[Test]
|
||||
public function filter_returns_an_ok_response(): void
|
||||
{
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user, 'api')->getJson('api/torrents/filter');
|
||||
use App\Models\Category;
|
||||
use App\Models\Torrent;
|
||||
use App\Models\User;
|
||||
|
||||
$response->assertOk()
|
||||
->assertJson([
|
||||
'data' => [],
|
||||
'links' => [
|
||||
'first' => null,
|
||||
'last' => null,
|
||||
'prev' => null,
|
||||
'next' => null,
|
||||
'self' => sprintf('%s/api/torrents', appurl()),
|
||||
],
|
||||
'meta' => [
|
||||
'path' => sprintf('%s/api/torrents/filter', appurl()),
|
||||
'per_page' => 25,
|
||||
'next_cursor' => null,
|
||||
'prev_cursor' => null,
|
||||
],
|
||||
]);
|
||||
}
|
||||
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.');
|
||||
|
||||
#[Test]
|
||||
public function index_returns_an_ok_response(): void
|
||||
{
|
||||
$user = User::factory()->create();
|
||||
$response = $this->actingAs($user, 'api')->getJson('api/torrents/filter');
|
||||
$response->assertOk();
|
||||
$response->assertJsonStructure([
|
||||
// TODO: compare expected response data
|
||||
]);
|
||||
|
||||
$response = $this->actingAs($user, 'api')->getJson(route('api.torrents.index'));
|
||||
// TODO: perform additional assertions
|
||||
});
|
||||
|
||||
$response->assertOk()
|
||||
->assertJson([
|
||||
'data' => [],
|
||||
'links' => [
|
||||
'first' => sprintf('%s/api/torrents?page=1', appurl()),
|
||||
'last' => sprintf('%s/api/torrents?page=1', appurl()),
|
||||
'prev' => null,
|
||||
'next' => null,
|
||||
'self' => sprintf('%s/api/torrents', appurl()),
|
||||
],
|
||||
'meta' => [
|
||||
'current_page' => 1,
|
||||
'from' => null,
|
||||
'last_page' => 1,
|
||||
'path' => sprintf('%s/api/torrents', appurl()),
|
||||
'per_page' => 25,
|
||||
'to' => null,
|
||||
'total' => 0,
|
||||
],
|
||||
]);
|
||||
}
|
||||
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.');
|
||||
|
||||
#[Test]
|
||||
public function show_returns_an_ok_response(): void
|
||||
{
|
||||
$user = User::factory()->create();
|
||||
$torrents = Torrent::factory()->times(3)->create();
|
||||
|
||||
$torrent = Torrent::factory()->create([
|
||||
'user_id' => $user->id,
|
||||
'status' => Torrent::APPROVED,
|
||||
]);
|
||||
$response = $this->getJson(route('api.torrents.index'));
|
||||
|
||||
$response = $this->actingAs($user, 'api')->getJson(sprintf('api/torrents/%s', $torrent->id));
|
||||
$response->assertOk();
|
||||
$response->assertJsonStructure([
|
||||
// TODO: compare expected response data
|
||||
]);
|
||||
|
||||
$response->assertOk()
|
||||
->assertJson([
|
||||
'type' => 'torrent',
|
||||
'id' => $torrent->id,
|
||||
]);
|
||||
}
|
||||
// TODO: perform additional assertions
|
||||
});
|
||||
|
||||
#[Test]
|
||||
public function store_returns_an_ok_response(): void
|
||||
{
|
||||
$this->seed(UsersTableSeeder::class);
|
||||
$this->seed(ChatroomTableSeeder::class);
|
||||
$this->seed(BotsTableSeeder::class);
|
||||
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.');
|
||||
|
||||
$user = User::factory()->create();
|
||||
$torrent = Torrent::factory()->create();
|
||||
|
||||
$category = Category::factory()->create();
|
||||
$type = Type::factory()->create();
|
||||
$resolution = Resolution::factory()->create();
|
||||
$response = $this->getJson('api/torrents/{id}');
|
||||
|
||||
$torrent = Torrent::factory()->make();
|
||||
$response->assertOk();
|
||||
$response->assertJsonStructure([
|
||||
// TODO: compare expected response data
|
||||
]);
|
||||
|
||||
$response = $this->actingAs($user, 'api')->postJson('api/torrents/upload', [
|
||||
'torrent' => new UploadedFile(
|
||||
base_path('tests/Resources/Pony Music - Mind Fragments (2014).torrent'),
|
||||
'Pony Music - Mind Fragments (2014).torrent'
|
||||
),
|
||||
'category_id' => $category->id,
|
||||
'name' => 'Pony Music - Mind Fragments (2014)',
|
||||
'description' => 'One song that represents the elements of being lost, abandoned, sadness and innocence.',
|
||||
'imdb' => $torrent->imdb,
|
||||
'tvdb' => $torrent->tvdb,
|
||||
'tmdb' => $torrent->tmdb,
|
||||
'mal' => $torrent->mal,
|
||||
'igdb' => $torrent->igdb,
|
||||
'type_id' => $type->id,
|
||||
'resolution_id' => $resolution->id,
|
||||
'anonymous' => $torrent->anon,
|
||||
'stream' => $torrent->stream,
|
||||
'sd' => $torrent->sd,
|
||||
'internal' => $torrent->internal,
|
||||
'featured' => false,
|
||||
'doubleup' => $torrent->doubleup,
|
||||
'free' => $torrent->free,
|
||||
'sticky' => $torrent->sticky,
|
||||
]);
|
||||
// TODO: perform additional assertions
|
||||
});
|
||||
|
||||
$response->assertOk()
|
||||
->assertJson([
|
||||
'success' => true,
|
||||
'message' => 'Torrent uploaded successfully.',
|
||||
]);
|
||||
}
|
||||
}
|
||||
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 = Category::factory()->create();
|
||||
$user = 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...
|
||||
|
||||
@@ -1,66 +0,0 @@
|
||||
<?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...
|
||||
@@ -1,54 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Feature\Http\Controllers;
|
||||
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.');
|
||||
|
||||
use PHPUnit\Framework\Attributes\Test;
|
||||
use App\Models\Torrent;
|
||||
use App\Models\User;
|
||||
use Database\Seeders\GroupsTableSeeder;
|
||||
use Tests\TestCase;
|
||||
$response = $this->get(route('announce', ['passkey' => $passkey]));
|
||||
|
||||
/**
|
||||
* @see \App\Http\Controllers\AnnounceController
|
||||
*/
|
||||
final class AnnounceControllerTest extends TestCase
|
||||
{
|
||||
#[Test]
|
||||
public function announce_returns_an_ok_response(): void
|
||||
{
|
||||
$this->seed(GroupsTableSeeder::class);
|
||||
$response->assertOk();
|
||||
|
||||
$user = User::factory()->create([
|
||||
'can_download' => true,
|
||||
]);
|
||||
// TODO: perform additional assertions
|
||||
});
|
||||
|
||||
$info_hash = '16679042096019090177'; // 20 bytes
|
||||
$peer_id = '19045931013802080695'; // 20 bytes
|
||||
|
||||
Torrent::factory()->create([
|
||||
'info_hash' => $info_hash,
|
||||
'status' => Torrent::APPROVED,
|
||||
]);
|
||||
|
||||
$headers = [
|
||||
'accept-language' => null,
|
||||
'referer' => null,
|
||||
'accept-charset' => null,
|
||||
'want-digest' => null,
|
||||
];
|
||||
|
||||
$response = $this->withHeaders($headers)->get(route('announce', [
|
||||
'passkey' => $user->passkey,
|
||||
'info_hash' => $info_hash,
|
||||
'peer_id' => $peer_id,
|
||||
'port' => 7022,
|
||||
'left' => 0,
|
||||
'uploaded' => 1,
|
||||
'downloaded' => 1,
|
||||
'compact' => 1,
|
||||
]))
|
||||
->assertOk();
|
||||
|
||||
$this->assertArrayNotHasKey('failure reason', [$response->getContent()]);
|
||||
}
|
||||
}
|
||||
// test cases...
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
<?php
|
||||
|
||||
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.');
|
||||
|
||||
$response = $this->get(route('announce', ['passkey' => $passkey]));
|
||||
|
||||
$response->assertOk();
|
||||
|
||||
// TODO: perform additional assertions
|
||||
});
|
||||
|
||||
// test cases...
|
||||
@@ -1,12 +1,24 @@
|
||||
<?php
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
|
||||
uses(RefreshDatabase::class);
|
||||
use App\Models\TorrentRequest;
|
||||
use App\Models\User;
|
||||
|
||||
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.');
|
||||
|
||||
$torrentRequest = \App\Models\TorrentRequest::factory()->create();
|
||||
$user = \App\Models\User::factory()->create();
|
||||
$torrentRequest = TorrentRequest::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->delete(route('requests.approved_fills.destroy', [$torrentRequest]));
|
||||
|
||||
@@ -19,8 +31,8 @@ test('destroy returns an ok response', function (): void {
|
||||
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.');
|
||||
|
||||
$torrentRequest = \App\Models\TorrentRequest::factory()->create();
|
||||
$user = \App\Models\User::factory()->create();
|
||||
$torrentRequest = TorrentRequest::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
// TODO: perform additional setup to trigger `abort_unless(403)`...
|
||||
|
||||
@@ -32,8 +44,8 @@ test('destroy aborts with a 403', function (): void {
|
||||
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.');
|
||||
|
||||
$torrentRequest = \App\Models\TorrentRequest::factory()->create();
|
||||
$user = \App\Models\User::factory()->create();
|
||||
$torrentRequest = TorrentRequest::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->post(route('requests.approved_fills.store', [$torrentRequest]), [
|
||||
// TODO: send request data
|
||||
@@ -47,8 +59,8 @@ test('store returns an ok response', function (): void {
|
||||
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.');
|
||||
|
||||
$torrentRequest = \App\Models\TorrentRequest::factory()->create();
|
||||
$user = \App\Models\User::factory()->create();
|
||||
$torrentRequest = TorrentRequest::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
// TODO: perform additional setup to trigger `abort_unless(403)`...
|
||||
|
||||
|
||||
@@ -1,44 +1,47 @@
|
||||
<?php
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
|
||||
namespace Tests\Feature\Http\Controllers;
|
||||
|
||||
use PHPUnit\Framework\Attributes\Test;
|
||||
use App\Models\Article;
|
||||
use App\Models\User;
|
||||
use Database\Seeders\GroupsTableSeeder;
|
||||
use Tests\TestCase;
|
||||
|
||||
/**
|
||||
* @see \App\Http\Controllers\ArticleController
|
||||
*/
|
||||
final class ArticleControllerTest extends TestCase
|
||||
{
|
||||
#[Test]
|
||||
public function index_returns_an_ok_response(): void
|
||||
{
|
||||
$this->seed(GroupsTableSeeder::class);
|
||||
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.');
|
||||
|
||||
$user = User::factory()->create();
|
||||
$articles = Article::factory()->times(3)->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->get(route('articles.index'));
|
||||
$response = $this->actingAs($user)->get(route('articles.index'));
|
||||
|
||||
$response->assertOk();
|
||||
$response->assertViewIs('article.index');
|
||||
$response->assertViewHas('articles');
|
||||
}
|
||||
$response->assertOk();
|
||||
$response->assertViewIs('article.index');
|
||||
$response->assertViewHas('articles', $articles);
|
||||
|
||||
#[Test]
|
||||
public function show_returns_an_ok_response(): void
|
||||
{
|
||||
$this->seed(GroupsTableSeeder::class);
|
||||
// TODO: perform additional assertions
|
||||
});
|
||||
|
||||
$article = Article::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
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.');
|
||||
|
||||
$response = $this->actingAs($user)->get(route('articles.show', ['article' => $article]));
|
||||
$article = Article::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response->assertOk();
|
||||
$response->assertViewIs('article.show');
|
||||
$response->assertViewHas('article');
|
||||
}
|
||||
}
|
||||
$response = $this->actingAs($user)->get(route('articles.show', [$article]));
|
||||
|
||||
$response->assertOk();
|
||||
$response->assertViewIs('article.show');
|
||||
$response->assertViewHas('article', $article);
|
||||
|
||||
// TODO: perform additional assertions
|
||||
});
|
||||
|
||||
// test cases...
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
<?php
|
||||
|
||||
uses(RefreshDatabase::class);
|
||||
|
||||
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.');
|
||||
|
||||
$articles = \App\Models\Article::factory()->times(3)->create();
|
||||
$user = \App\Models\User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->get(route('articles.index'));
|
||||
|
||||
$response->assertOk();
|
||||
$response->assertViewIs('article.index');
|
||||
$response->assertViewHas('articles', $articles);
|
||||
|
||||
// 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.');
|
||||
|
||||
$article = \App\Models\Article::factory()->create();
|
||||
$user = \App\Models\User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->get(route('articles.show', [$article]));
|
||||
|
||||
$response->assertOk();
|
||||
$response->assertViewIs('article.show');
|
||||
$response->assertViewHas('article', $article);
|
||||
|
||||
// TODO: perform additional assertions
|
||||
});
|
||||
|
||||
// test cases...
|
||||
@@ -1,26 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Feature\Http\Controllers\Auth;
|
||||
|
||||
use PHPUnit\Framework\Attributes\Test;
|
||||
use App\Models\UserActivation;
|
||||
use Database\Seeders\GroupsTableSeeder;
|
||||
use Tests\TestCase;
|
||||
|
||||
/**
|
||||
* @see \App\Http\Controllers\Auth\ActivationController
|
||||
* 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
|
||||
*/
|
||||
final class ActivationControllerTest extends TestCase
|
||||
{
|
||||
#[Test]
|
||||
public function activate_returns_an_ok_response(): void
|
||||
{
|
||||
$this->seed(GroupsTableSeeder::class);
|
||||
test('activate 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.');
|
||||
|
||||
$activation = UserActivation::factory()->create();
|
||||
$response = $this->get(route('activate', ['token' => $token]));
|
||||
|
||||
$this->get(route('activate', ['token' => $activation->token]))
|
||||
->assertRedirect(route('login'))
|
||||
->assertSessionHas('success', trans('auth.activation-success'));
|
||||
}
|
||||
}
|
||||
$response->assertOk();
|
||||
|
||||
// TODO: perform additional assertions
|
||||
});
|
||||
|
||||
// test cases...
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
<?php
|
||||
|
||||
test('activate 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->get(route('activate', ['token' => $token]));
|
||||
|
||||
$response->assertOk();
|
||||
|
||||
// TODO: perform additional assertions
|
||||
});
|
||||
|
||||
// test cases...
|
||||
@@ -1,37 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Feature\Http\Controllers\Auth;
|
||||
|
||||
use PHPUnit\Framework\Attributes\Test;
|
||||
use App\Models\Application;
|
||||
use Tests\TestCase;
|
||||
|
||||
/**
|
||||
* @see \App\Http\Controllers\Auth\ApplicationController
|
||||
* 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
|
||||
*/
|
||||
final class ApplicationControllerTest extends TestCase
|
||||
{
|
||||
#[Test]
|
||||
public function create_returns_an_ok_response(): void
|
||||
{
|
||||
$this->get(route('application.create'))
|
||||
->assertOk()
|
||||
->assertViewIs('auth.application.create');
|
||||
}
|
||||
test('create 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.');
|
||||
|
||||
#[Test]
|
||||
public function store_returns_an_ok_response(): void
|
||||
{
|
||||
config(['captcha.enabled' => false]);
|
||||
$response = $this->get(route('application.create'));
|
||||
|
||||
$application = Application::factory()->make();
|
||||
$response->assertOk();
|
||||
$response->assertViewIs('auth.application.create');
|
||||
|
||||
$this->post(route('application.store'), [
|
||||
'type' => $application->type,
|
||||
'email' => $application->email,
|
||||
'referrer' => $application->referrer,
|
||||
])
|
||||
->assertRedirect(route('login'))
|
||||
->assertSessionHas('success', trans('auth.application-submitted'));
|
||||
}
|
||||
}
|
||||
// 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.');
|
||||
|
||||
$response = $this->post(route('application.store'), [
|
||||
// TODO: send request data
|
||||
]);
|
||||
|
||||
$response->assertOk();
|
||||
|
||||
// TODO: perform additional assertions
|
||||
});
|
||||
|
||||
// test cases...
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
<?php
|
||||
|
||||
test('create 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->get(route('application.create'));
|
||||
|
||||
$response->assertOk();
|
||||
$response->assertViewIs('auth.application.create');
|
||||
|
||||
// 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.');
|
||||
|
||||
$response = $this->post(route('application.store'), [
|
||||
// TODO: send request data
|
||||
]);
|
||||
|
||||
$response->assertOk();
|
||||
|
||||
// TODO: perform additional assertions
|
||||
});
|
||||
|
||||
// test cases...
|
||||
@@ -1,35 +1,41 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Feature\Http\Controllers\Auth;
|
||||
|
||||
use PHPUnit\Framework\Attributes\Test;
|
||||
use App\Models\User;
|
||||
use Tests\TestCase;
|
||||
|
||||
/**
|
||||
* @see \App\Http\Controllers\Auth\ForgotUsernameController
|
||||
* 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
|
||||
*/
|
||||
final class ForgotUsernameControllerTest extends TestCase
|
||||
{
|
||||
#[Test]
|
||||
public function send_username_reminder_returns_an_ok_response(): void
|
||||
{
|
||||
config(['captcha.enabled' => false]);
|
||||
|
||||
$user = User::factory()->create();
|
||||
use App\Models\User;
|
||||
|
||||
$this->post(route('username.email'), [
|
||||
'email' => $user->email,
|
||||
])
|
||||
->assertRedirect(route('login'))
|
||||
->assertSessionHas('success', trans('email.username-sent'));
|
||||
}
|
||||
test('send username reminder 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.');
|
||||
|
||||
#[Test]
|
||||
public function show_forgot_username_form_returns_an_ok_response(): void
|
||||
{
|
||||
$this->get(route('username.request'))
|
||||
->assertOk()
|
||||
->assertViewIs('auth.username');
|
||||
}
|
||||
}
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = $this->post(route('username.email'), [
|
||||
// TODO: send request data
|
||||
]);
|
||||
|
||||
$response->assertOk();
|
||||
|
||||
// TODO: perform additional assertions
|
||||
});
|
||||
|
||||
test('show forgot username form 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->get(route('username.request'));
|
||||
|
||||
$response->assertOk();
|
||||
$response->assertViewIs('auth.username');
|
||||
|
||||
// TODO: perform additional assertions
|
||||
});
|
||||
|
||||
// test cases...
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
<?php
|
||||
|
||||
uses(RefreshDatabase::class);
|
||||
|
||||
test('send username reminder 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 = \App\Models\User::factory()->create();
|
||||
|
||||
$response = $this->post(route('username.email'), [
|
||||
// TODO: send request data
|
||||
]);
|
||||
|
||||
$response->assertOk();
|
||||
|
||||
// TODO: perform additional assertions
|
||||
});
|
||||
|
||||
test('show forgot username form 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->get(route('username.request'));
|
||||
|
||||
$response->assertOk();
|
||||
$response->assertViewIs('auth.username');
|
||||
|
||||
// TODO: perform additional assertions
|
||||
});
|
||||
|
||||
// test cases...
|
||||
@@ -1,78 +1,97 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Feature\Http\Controllers\Auth;
|
||||
|
||||
use PHPUnit\Framework\Attributes\Test;
|
||||
use App\Models\TwoStepAuth;
|
||||
use App\Models\User;
|
||||
use Database\Seeders\GroupsTableSeeder;
|
||||
use Tests\TestCase;
|
||||
|
||||
/**
|
||||
* @see \App\Http\Controllers\Auth\TwoStepController
|
||||
* 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
|
||||
*/
|
||||
final class TwoStepControllerTest extends TestCase
|
||||
{
|
||||
#[Test]
|
||||
public function resend_returns_an_ok_response(): void
|
||||
{
|
||||
config(['auth.TwoStepEnabled' => true]);
|
||||
|
||||
$this->seed(GroupsTableSeeder::class);
|
||||
use App\Models\User;
|
||||
|
||||
$user = User::factory()->create([
|
||||
'twostep' => true,
|
||||
]);
|
||||
test('resend 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.');
|
||||
|
||||
TwoStepAuth::factory()->create([
|
||||
'userId' => $user->id,
|
||||
]);
|
||||
$user = User::factory()->create();
|
||||
|
||||
$this->actingAs($user)->post(route('resend'))
|
||||
->assertRedirect(route('verificationNeeded'));
|
||||
}
|
||||
$response = $this->actingAs($user)->post(route('resend'), [
|
||||
// TODO: send request data
|
||||
]);
|
||||
|
||||
#[Test]
|
||||
public function show_verification_returns_an_ok_response(): void
|
||||
{
|
||||
config(['auth.TwoStepEnabled' => true]);
|
||||
$response->assertOk();
|
||||
|
||||
$this->seed(GroupsTableSeeder::class);
|
||||
// TODO: perform additional assertions
|
||||
});
|
||||
|
||||
$user = User::factory()->create([
|
||||
'twostep' => true,
|
||||
]);
|
||||
test('resend aborts with a 404', function (): void {
|
||||
$this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.');
|
||||
|
||||
TwoStepAuth::factory()->create([
|
||||
'userId' => $user->id,
|
||||
]);
|
||||
$user = User::factory()->create();
|
||||
|
||||
$this->actingAs($user)->get(route('verificationNeeded'))
|
||||
->assertOk()
|
||||
->assertViewIs('auth.twostep-verification');
|
||||
}
|
||||
// TODO: perform additional setup to trigger `abort_if(404)`...
|
||||
|
||||
#[Test]
|
||||
public function verify_returns_an_ok_response(): void
|
||||
{
|
||||
config(['auth.TwoStepEnabled' => true]);
|
||||
$response = $this->actingAs($user)->post(route('resend'), [
|
||||
// TODO: send request data
|
||||
]);
|
||||
|
||||
$this->seed(GroupsTableSeeder::class);
|
||||
$response->assertNotFound();
|
||||
});
|
||||
|
||||
$user = User::factory()->create([
|
||||
'twostep' => true,
|
||||
]);
|
||||
test('show verification 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.');
|
||||
|
||||
$twoStep = TwoStepAuth::factory()->create([
|
||||
'userId' => $user->id,
|
||||
]);
|
||||
$user = User::factory()->create();
|
||||
|
||||
$this->actingAs($user)->postJson(route('verify'), [
|
||||
'v_input_1' => $twoStep->authCode[0],
|
||||
'v_input_2' => $twoStep->authCode[1],
|
||||
'v_input_3' => $twoStep->authCode[2],
|
||||
'v_input_4' => $twoStep->authCode[3],
|
||||
], ['HTTP_X-Requested-With' => 'XMLHttpRequest'])
|
||||
->assertOk();
|
||||
}
|
||||
}
|
||||
$response = $this->actingAs($user)->get(route('verificationNeeded'));
|
||||
|
||||
$response->assertOk();
|
||||
$response->assertViewIs('auth.twostep-exceeded');
|
||||
|
||||
// TODO: perform additional assertions
|
||||
});
|
||||
|
||||
test('show verification aborts with a 404', 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();
|
||||
|
||||
// TODO: perform additional setup to trigger `abort_if(404)`...
|
||||
|
||||
$response = $this->actingAs($user)->get(route('verificationNeeded'));
|
||||
|
||||
$response->assertNotFound();
|
||||
});
|
||||
|
||||
test('verify 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(route('verify'), [
|
||||
// TODO: send request data
|
||||
]);
|
||||
|
||||
$response->assertOk();
|
||||
|
||||
// TODO: perform additional assertions
|
||||
});
|
||||
|
||||
test('verify aborts with a 404', 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();
|
||||
|
||||
// TODO: perform additional setup to trigger `abort_if(404)`...
|
||||
|
||||
$response = $this->actingAs($user)->post(route('verify'), [
|
||||
// TODO: send request data
|
||||
]);
|
||||
|
||||
$response->assertNotFound();
|
||||
});
|
||||
|
||||
// test cases...
|
||||
|
||||
@@ -1,100 +0,0 @@
|
||||
<?php
|
||||
|
||||
uses(RefreshDatabase::class);
|
||||
|
||||
test('resend 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 = \App\Models\User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->post(route('resend'), [
|
||||
// TODO: send request data
|
||||
]);
|
||||
|
||||
$response->assertOk();
|
||||
|
||||
// TODO: perform additional assertions
|
||||
});
|
||||
|
||||
test('resend aborts with a 404', function (): void {
|
||||
$this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.');
|
||||
|
||||
$user = \App\Models\User::factory()->create();
|
||||
|
||||
// TODO: perform additional setup to trigger `abort_if(404)`...
|
||||
|
||||
$response = $this->actingAs($user)->post(route('resend'), [
|
||||
// TODO: send request data
|
||||
]);
|
||||
|
||||
$response->assertNotFound();
|
||||
});
|
||||
|
||||
test('show verification 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 = \App\Models\User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->get(route('verificationNeeded'));
|
||||
|
||||
$response->assertOk();
|
||||
$response->assertViewIs('auth.twostep-exceeded');
|
||||
|
||||
// TODO: perform additional assertions
|
||||
});
|
||||
|
||||
test('show verification aborts with a 404', function (): void {
|
||||
$this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.');
|
||||
|
||||
$user = \App\Models\User::factory()->create();
|
||||
|
||||
// TODO: perform additional setup to trigger `abort_if(404)`...
|
||||
|
||||
$response = $this->actingAs($user)->get(route('verificationNeeded'));
|
||||
|
||||
$response->assertNotFound();
|
||||
});
|
||||
|
||||
test('verify 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 = \App\Models\User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->post(route('verify'), [
|
||||
// TODO: send request data
|
||||
]);
|
||||
|
||||
$response->assertOk();
|
||||
|
||||
// TODO: perform additional assertions
|
||||
});
|
||||
|
||||
test('verify aborts with a 404', function (): void {
|
||||
$this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.');
|
||||
|
||||
$user = \App\Models\User::factory()->create();
|
||||
|
||||
// TODO: perform additional setup to trigger `abort_if(404)`...
|
||||
|
||||
$response = $this->actingAs($user)->post(route('verify'), [
|
||||
// TODO: send request data
|
||||
]);
|
||||
|
||||
$response->assertNotFound();
|
||||
});
|
||||
|
||||
test('verify aborts with a 404', function (): void {
|
||||
$this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.');
|
||||
|
||||
$user = \App\Models\User::factory()->create();
|
||||
|
||||
// TODO: perform additional setup to trigger `abort(404)`...
|
||||
|
||||
$response = $this->actingAs($user)->post(route('verify'), [
|
||||
// TODO: send request data
|
||||
]);
|
||||
|
||||
$response->assertNotFound();
|
||||
});
|
||||
|
||||
// test cases...
|
||||
@@ -1,20 +1,34 @@
|
||||
<?php
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
|
||||
uses(RefreshDatabase::class);
|
||||
use App\Http\Controllers\BountyController;
|
||||
use App\Http\Requests\StoreTorrentRequestBountyRequest;
|
||||
use App\Models\TorrentRequest;
|
||||
use App\Models\User;
|
||||
|
||||
test('store validates with a form request', function (): void {
|
||||
$this->assertActionUsesFormRequest(
|
||||
\App\Http\Controllers\BountyController::class,
|
||||
BountyController::class,
|
||||
'store',
|
||||
\App\Http\Requests\StoreTorrentRequestBountyRequest::class
|
||||
StoreTorrentRequestBountyRequest::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.');
|
||||
|
||||
$torrentRequest = \App\Models\TorrentRequest::factory()->create();
|
||||
$user = \App\Models\User::factory()->create();
|
||||
$torrentRequest = TorrentRequest::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->post(route('requests.bounties.store', [$torrentRequest]), [
|
||||
// TODO: send request data
|
||||
@@ -28,8 +42,8 @@ test('store returns an ok response', function (): void {
|
||||
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.');
|
||||
|
||||
$torrentRequest = \App\Models\TorrentRequest::factory()->create();
|
||||
$user = \App\Models\User::factory()->create();
|
||||
$torrentRequest = TorrentRequest::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
// TODO: perform additional setup to trigger `abort_unless(403)`...
|
||||
|
||||
|
||||
@@ -1,13 +1,28 @@
|
||||
<?php
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
|
||||
uses(RefreshDatabase::class);
|
||||
use App\Http\Controllers\ClaimController;
|
||||
use App\Http\Requests\StoreTorrentRequestClaimRequest;
|
||||
use App\Models\TorrentRequest;
|
||||
use App\Models\TorrentRequestClaim;
|
||||
use App\Models\User;
|
||||
|
||||
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.');
|
||||
|
||||
$torrentRequest = \App\Models\TorrentRequest::factory()->create();
|
||||
$torrentRequestClaim = \App\Models\TorrentRequestClaim::factory()->create();
|
||||
$user = \App\Models\User::factory()->create();
|
||||
$torrentRequest = TorrentRequest::factory()->create();
|
||||
$torrentRequestClaim = TorrentRequestClaim::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->delete(route('requests.claims.destroy', [$torrentRequest, 'claim' => $claim]));
|
||||
|
||||
@@ -20,9 +35,9 @@ test('destroy returns an ok response', function (): void {
|
||||
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.');
|
||||
|
||||
$torrentRequest = \App\Models\TorrentRequest::factory()->create();
|
||||
$torrentRequestClaim = \App\Models\TorrentRequestClaim::factory()->create();
|
||||
$user = \App\Models\User::factory()->create();
|
||||
$torrentRequest = TorrentRequest::factory()->create();
|
||||
$torrentRequestClaim = TorrentRequestClaim::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
// TODO: perform additional setup to trigger `abort_unless(403)`...
|
||||
|
||||
@@ -33,17 +48,17 @@ test('destroy aborts with a 403', function (): void {
|
||||
|
||||
test('store validates with a form request', function (): void {
|
||||
$this->assertActionUsesFormRequest(
|
||||
\App\Http\Controllers\ClaimController::class,
|
||||
ClaimController::class,
|
||||
'store',
|
||||
\App\Http\Requests\StoreTorrentRequestClaimRequest::class
|
||||
StoreTorrentRequestClaimRequest::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.');
|
||||
|
||||
$torrentRequest = \App\Models\TorrentRequest::factory()->create();
|
||||
$user = \App\Models\User::factory()->create();
|
||||
$torrentRequest = TorrentRequest::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->post(route('requests.claims.store', [$torrentRequest]), [
|
||||
// TODO: send request data
|
||||
|
||||
@@ -1,47 +1,44 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Feature\Http\Controllers;
|
||||
|
||||
use PHPUnit\Framework\Attributes\Test;
|
||||
use App\Models\User;
|
||||
use Database\Seeders\GroupsTableSeeder;
|
||||
use Database\Seeders\UsersTableSeeder;
|
||||
use Tests\TestCase;
|
||||
|
||||
/**
|
||||
* @see \App\Http\Controllers\ContactController
|
||||
* 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
|
||||
*/
|
||||
final class ContactControllerTest extends TestCase
|
||||
{
|
||||
#[Test]
|
||||
public function index_returns_an_ok_response(): void
|
||||
{
|
||||
$this->seed(UsersTableSeeder::class);
|
||||
$this->seed(GroupsTableSeeder::class);
|
||||
|
||||
$user = User::factory()->create();
|
||||
use App\Models\User;
|
||||
|
||||
$response = $this->actingAs($user)->get(route('contact.index'));
|
||||
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.');
|
||||
|
||||
$response->assertOk()
|
||||
->assertViewIs('contact.index');
|
||||
}
|
||||
$user = User::factory()->create();
|
||||
|
||||
#[Test]
|
||||
public function store_returns_an_ok_response(): void
|
||||
{
|
||||
$this->seed(UsersTableSeeder::class);
|
||||
$this->seed(GroupsTableSeeder::class);
|
||||
$response = $this->actingAs($user)->get(route('contact.index'));
|
||||
|
||||
$user = User::factory()->create();
|
||||
$response->assertOk();
|
||||
$response->assertViewIs('contact.index');
|
||||
|
||||
$response = $this->actingAs($user)->post(route('contact.store'), [
|
||||
'email' => 'foo@bar.com',
|
||||
'contact-name' => 'Foo Bar',
|
||||
'message' => 'Hello, world!',
|
||||
]);
|
||||
// TODO: perform additional assertions
|
||||
});
|
||||
|
||||
$response->assertRedirect(route('home.index'))
|
||||
->assertSessionHas('success', 'Your Message Was Successfully Sent');
|
||||
}
|
||||
}
|
||||
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.');
|
||||
|
||||
$user = User::factory()->create();
|
||||
$authUser = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($authUser)->post(route('contact.store'), [
|
||||
// TODO: send request data
|
||||
]);
|
||||
|
||||
$response->assertOk();
|
||||
|
||||
// TODO: perform additional assertions
|
||||
});
|
||||
|
||||
// test cases...
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
<?php
|
||||
|
||||
uses(RefreshDatabase::class);
|
||||
|
||||
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.');
|
||||
|
||||
$user = \App\Models\User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->get(route('contact.index'));
|
||||
|
||||
$response->assertOk();
|
||||
$response->assertViewIs('contact.index');
|
||||
|
||||
// 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.');
|
||||
|
||||
$user = \App\Models\User::factory()->create();
|
||||
$authUser = \App\Models\User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($authUser)->post(route('contact.store'), [
|
||||
// TODO: send request data
|
||||
]);
|
||||
|
||||
$response->assertOk();
|
||||
|
||||
// TODO: perform additional assertions
|
||||
});
|
||||
|
||||
// test cases...
|
||||
@@ -1,12 +1,24 @@
|
||||
<?php
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
|
||||
uses(RefreshDatabase::class);
|
||||
use App\Models\Forum;
|
||||
use App\Models\User;
|
||||
|
||||
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.');
|
||||
|
||||
$forum = \App\Models\Forum::factory()->create();
|
||||
$user = \App\Models\User::factory()->create();
|
||||
$forum = Forum::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->get(route('forums.categories.show', ['id' => $id]));
|
||||
|
||||
|
||||
@@ -1,105 +1,50 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Feature\Http\Controllers;
|
||||
|
||||
use PHPUnit\Framework\Attributes\Test;
|
||||
use App\Http\Livewire\PostSearch;
|
||||
use App\Http\Livewire\SubscribedForum;
|
||||
use App\Http\Livewire\TopicSearch;
|
||||
use App\Models\Forum;
|
||||
use App\Models\Permission;
|
||||
use App\Models\User;
|
||||
use Database\Seeders\GroupsTableSeeder;
|
||||
use Database\Seeders\UsersTableSeeder;
|
||||
use Tests\TestCase;
|
||||
|
||||
/**
|
||||
* @see \App\Http\Controllers\ForumController
|
||||
* 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
|
||||
*/
|
||||
final class ForumControllerTest extends TestCase
|
||||
{
|
||||
#[Test]
|
||||
public function index_returns_an_ok_response(): void
|
||||
{
|
||||
$this->seed(UsersTableSeeder::class);
|
||||
$this->seed(GroupsTableSeeder::class);
|
||||
|
||||
$user = User::factory()->create();
|
||||
use App\Models\Forum;
|
||||
use App\Models\User;
|
||||
|
||||
$this->actingAs($user)->get(route('forums.index'))
|
||||
->assertOk()
|
||||
->assertViewIs('forum.index')
|
||||
->assertViewHas('categories')
|
||||
->assertViewHas('num_posts')
|
||||
->assertViewHas('num_forums')
|
||||
->assertViewHas('num_topics');
|
||||
}
|
||||
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.');
|
||||
|
||||
#[Test]
|
||||
public function latest_posts_returns_an_ok_response(): void
|
||||
{
|
||||
$this->seed(UsersTableSeeder::class);
|
||||
$this->seed(GroupsTableSeeder::class);
|
||||
$forums = Forum::factory()->times(3)->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
$user = User::factory()->create();
|
||||
$response = $this->actingAs($user)->get(route('forums.index'));
|
||||
|
||||
$this->actingAs($user)->get(route('posts.index'))
|
||||
->assertOk()
|
||||
->assertViewIs('forum.post.index')
|
||||
->assertSeeLivewire(PostSearch::class);
|
||||
}
|
||||
$response->assertOk();
|
||||
$response->assertViewIs('forum.index');
|
||||
$response->assertViewHas('categories');
|
||||
$response->assertViewHas('num_posts');
|
||||
$response->assertViewHas('num_forums');
|
||||
$response->assertViewHas('num_topics');
|
||||
|
||||
#[Test]
|
||||
public function latest_topics_returns_an_ok_response(): void
|
||||
{
|
||||
$this->seed(UsersTableSeeder::class);
|
||||
$this->seed(GroupsTableSeeder::class);
|
||||
// TODO: perform additional assertions
|
||||
});
|
||||
|
||||
$user = User::factory()->create();
|
||||
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.');
|
||||
|
||||
$this->actingAs($user)->get(route('topics.index'))
|
||||
->assertOk()
|
||||
->assertViewIs('forum.topic.index')
|
||||
->assertSeeLivewire(TopicSearch::class);
|
||||
}
|
||||
$forum = Forum::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
#[Test]
|
||||
public function show_forum_returns_an_ok_response(): void
|
||||
{
|
||||
$this->seed(UsersTableSeeder::class);
|
||||
$this->seed(GroupsTableSeeder::class);
|
||||
$response = $this->actingAs($user)->get(route('forums.show', ['id' => $forum->id]));
|
||||
|
||||
$user = User::factory()->create();
|
||||
$response->assertOk();
|
||||
$response->assertViewIs('forum.forum_topic.index');
|
||||
$response->assertViewHas('forum', $forum);
|
||||
|
||||
// This Forum does not have a parent, which makes it a proper Forum
|
||||
// (and not a "Forum Category").
|
||||
// TODO: perform additional assertions
|
||||
});
|
||||
|
||||
$forum = Forum::factory()->create([
|
||||
'parent_id' => 0,
|
||||
'last_post_user_id' => $user->id,
|
||||
'last_post_user_username' => $user->username,
|
||||
]);
|
||||
|
||||
$permissions = Permission::factory()->create([
|
||||
'forum_id' => $forum->id,
|
||||
'show_forum' => true,
|
||||
]);
|
||||
|
||||
$this->actingAs($user)->get(route('forums.show', ['id' => $forum->id]))
|
||||
->assertRedirect(route('forums.categories.show', ['id' => $forum->id]));
|
||||
}
|
||||
|
||||
#[Test]
|
||||
public function subscriptions_returns_an_ok_response(): void
|
||||
{
|
||||
$this->seed(UsersTableSeeder::class);
|
||||
$this->seed(GroupsTableSeeder::class);
|
||||
|
||||
$user = User::factory()->create();
|
||||
|
||||
$this->actingAs($user)->get(route('subscriptions.index'))
|
||||
->assertOk()
|
||||
->assertViewIs('forum.subscriptions')
|
||||
->assertSeeLivewire(SubscribedForum::class);
|
||||
}
|
||||
}
|
||||
// test cases...
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
<?php
|
||||
|
||||
uses(RefreshDatabase::class);
|
||||
|
||||
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.');
|
||||
|
||||
$forums = \App\Models\Forum::factory()->times(3)->create();
|
||||
$user = \App\Models\User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->get(route('forums.index'));
|
||||
|
||||
$response->assertOk();
|
||||
$response->assertViewIs('forum.index');
|
||||
$response->assertViewHas('categories');
|
||||
$response->assertViewHas('num_posts');
|
||||
$response->assertViewHas('num_forums');
|
||||
$response->assertViewHas('num_topics');
|
||||
|
||||
// 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.');
|
||||
|
||||
$forum = \App\Models\Forum::factory()->create();
|
||||
$user = \App\Models\User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->get(route('forums.show', ['id' => $forum->id]));
|
||||
|
||||
$response->assertOk();
|
||||
$response->assertViewIs('forum.forum_topic.index');
|
||||
$response->assertViewHas('forum', $forum);
|
||||
|
||||
// TODO: perform additional assertions
|
||||
});
|
||||
|
||||
// test cases...
|
||||
@@ -1,70 +1,70 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Feature\Http\Controllers;
|
||||
|
||||
use PHPUnit\Framework\Attributes\Test;
|
||||
use App\Models\User;
|
||||
use Database\Seeders\GroupsTableSeeder;
|
||||
use Tests\TestCase;
|
||||
|
||||
/**
|
||||
* @see \App\Http\Controllers\HomeController
|
||||
* 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
|
||||
*/
|
||||
final class HomeControllerTest extends TestCase
|
||||
{
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
$this->seed(GroupsTableSeeder::class);
|
||||
}
|
||||
use App\Models\Article;
|
||||
use App\Models\Bookmark;
|
||||
use App\Models\FeaturedTorrent;
|
||||
use App\Models\FreeleechToken;
|
||||
use App\Models\Group;
|
||||
use App\Models\Movie;
|
||||
use App\Models\Poll;
|
||||
use App\Models\Post;
|
||||
use App\Models\Topic;
|
||||
use App\Models\Torrent;
|
||||
use App\Models\Tv;
|
||||
use App\Models\User;
|
||||
|
||||
#[Test]
|
||||
public function whenNotAuthenticatedHomepageRedirectsToLogin(): void
|
||||
{
|
||||
$response = $this->get('/');
|
||||
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.');
|
||||
|
||||
$response->assertRedirect(route('login'));
|
||||
}
|
||||
$poll = Poll::factory()->create();
|
||||
$articles = Article::factory()->times(3)->create();
|
||||
$users = User::factory()->times(3)->create();
|
||||
$groups = Group::factory()->times(3)->create();
|
||||
$torrents = Torrent::factory()->times(3)->create();
|
||||
$movies = Movie::factory()->times(3)->create();
|
||||
$tvs = Tv::factory()->times(3)->create();
|
||||
$topics = Topic::factory()->times(3)->create();
|
||||
$posts = Post::factory()->times(3)->create();
|
||||
$featuredTorrents = FeaturedTorrent::factory()->times(3)->create();
|
||||
$freeleechTokens = FreeleechToken::factory()->times(3)->create();
|
||||
$bookmarks = Bookmark::factory()->times(3)->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
#[Test]
|
||||
public function whenAuthenticatedHomepageReturns200(): void
|
||||
{
|
||||
$user = User::factory()->create();
|
||||
$response = $this->actingAs($user)->get(route('home.index'));
|
||||
|
||||
$this->actingAs($user)
|
||||
->get(route('home.index'))
|
||||
->assertOk()
|
||||
->assertViewIs('home.index')
|
||||
->assertViewHas('user')
|
||||
->assertViewHas('personal_freeleech')
|
||||
->assertViewHas('users')
|
||||
->assertViewHas('groups')
|
||||
->assertViewHas('articles')
|
||||
->assertViewHas('newest')
|
||||
->assertViewHas('seeded')
|
||||
->assertViewHas('dying')
|
||||
->assertViewHas('leeched')
|
||||
->assertViewHas('dead')
|
||||
->assertViewHas('topics')
|
||||
->assertViewHas('posts')
|
||||
->assertViewHas('featured')
|
||||
->assertViewHas('poll')
|
||||
->assertViewHas('uploaders')
|
||||
->assertViewHas('past_uploaders')
|
||||
->assertViewHas('freeleech_tokens')
|
||||
->assertViewHas('bookmarks');
|
||||
}
|
||||
$response->assertOk();
|
||||
$response->assertViewIs('home.index');
|
||||
$response->assertViewHas('user', $user);
|
||||
$response->assertViewHas('personal_freeleech');
|
||||
$response->assertViewHas('users', $users);
|
||||
$response->assertViewHas('groups', $groups);
|
||||
$response->assertViewHas('articles', $articles);
|
||||
$response->assertViewHas('newest');
|
||||
$response->assertViewHas('seeded');
|
||||
$response->assertViewHas('dying');
|
||||
$response->assertViewHas('leeched');
|
||||
$response->assertViewHas('dead');
|
||||
$response->assertViewHas('topics', $topics);
|
||||
$response->assertViewHas('posts', $posts);
|
||||
$response->assertViewHas('featured');
|
||||
$response->assertViewHas('poll', $poll);
|
||||
$response->assertViewHas('uploaders');
|
||||
$response->assertViewHas('past_uploaders');
|
||||
$response->assertViewHas('freeleech_tokens');
|
||||
$response->assertViewHas('bookmarks', $bookmarks);
|
||||
|
||||
#[Test]
|
||||
public function whenAuthenticatedAndTwoStepRequiredHomepageRedirectsToTwoStep(): void
|
||||
{
|
||||
$user = User::factory()->create([
|
||||
'twostep' => true,
|
||||
]);
|
||||
// TODO: perform additional assertions
|
||||
});
|
||||
|
||||
$this->actingAs($user)
|
||||
->get(route('home.index'))
|
||||
->assertRedirect(route('verificationNeeded'));
|
||||
}
|
||||
}
|
||||
// test cases...
|
||||
|
||||
@@ -1,48 +0,0 @@
|
||||
<?php
|
||||
|
||||
uses(RefreshDatabase::class);
|
||||
|
||||
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.');
|
||||
|
||||
$poll = \App\Models\Poll::factory()->create();
|
||||
$articles = \App\Models\Article::factory()->times(3)->create();
|
||||
$users = \App\Models\User::factory()->times(3)->create();
|
||||
$groups = \App\Models\Group::factory()->times(3)->create();
|
||||
$torrents = \App\Models\Torrent::factory()->times(3)->create();
|
||||
$movies = \App\Models\Movie::factory()->times(3)->create();
|
||||
$tvs = \App\Models\Tv::factory()->times(3)->create();
|
||||
$topics = \App\Models\Topic::factory()->times(3)->create();
|
||||
$posts = \App\Models\Post::factory()->times(3)->create();
|
||||
$featuredTorrents = \App\Models\FeaturedTorrent::factory()->times(3)->create();
|
||||
$freeleechTokens = \App\Models\FreeleechToken::factory()->times(3)->create();
|
||||
$bookmarks = \App\Models\Bookmark::factory()->times(3)->create();
|
||||
$user = \App\Models\User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->get(route('home.index'));
|
||||
|
||||
$response->assertOk();
|
||||
$response->assertViewIs('home.index');
|
||||
$response->assertViewHas('user', $user);
|
||||
$response->assertViewHas('personal_freeleech');
|
||||
$response->assertViewHas('users', $users);
|
||||
$response->assertViewHas('groups', $groups);
|
||||
$response->assertViewHas('articles', $articles);
|
||||
$response->assertViewHas('newest');
|
||||
$response->assertViewHas('seeded');
|
||||
$response->assertViewHas('dying');
|
||||
$response->assertViewHas('leeched');
|
||||
$response->assertViewHas('dead');
|
||||
$response->assertViewHas('topics', $topics);
|
||||
$response->assertViewHas('posts', $posts);
|
||||
$response->assertViewHas('featured');
|
||||
$response->assertViewHas('poll', $poll);
|
||||
$response->assertViewHas('uploaders');
|
||||
$response->assertViewHas('past_uploaders');
|
||||
$response->assertViewHas('freeleech_tokens');
|
||||
$response->assertViewHas('bookmarks', $bookmarks);
|
||||
|
||||
// TODO: perform additional assertions
|
||||
});
|
||||
|
||||
// test cases...
|
||||
@@ -1,11 +1,23 @@
|
||||
<?php
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
|
||||
uses(RefreshDatabase::class);
|
||||
use App\Models\Collection;
|
||||
use App\Models\User;
|
||||
|
||||
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.');
|
||||
|
||||
$user = \App\Models\User::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->get(route('mediahub.collections.index'));
|
||||
|
||||
@@ -18,8 +30,8 @@ test('index returns an ok response', function (): void {
|
||||
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.');
|
||||
|
||||
$collection = \App\Models\Collection::factory()->create();
|
||||
$user = \App\Models\User::factory()->create();
|
||||
$collection = Collection::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->get(route('mediahub.collections.show', ['id' => $collection->id]));
|
||||
|
||||
|
||||
@@ -1,11 +1,22 @@
|
||||
<?php
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
|
||||
uses(RefreshDatabase::class);
|
||||
use App\Models\User;
|
||||
|
||||
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.');
|
||||
|
||||
$user = \App\Models\User::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->get(route('mediahub.companies.index'));
|
||||
|
||||
|
||||
@@ -1,12 +1,24 @@
|
||||
<?php
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
|
||||
uses(RefreshDatabase::class);
|
||||
use App\Models\Genre;
|
||||
use App\Models\User;
|
||||
|
||||
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.');
|
||||
|
||||
$genres = \App\Models\Genre::factory()->times(3)->create();
|
||||
$user = \App\Models\User::factory()->create();
|
||||
$genres = Genre::factory()->times(3)->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->get(route('mediahub.genres.index'));
|
||||
|
||||
|
||||
@@ -1,11 +1,22 @@
|
||||
<?php
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
|
||||
uses(RefreshDatabase::class);
|
||||
use App\Models\User;
|
||||
|
||||
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.');
|
||||
|
||||
$user = \App\Models\User::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->get(route('mediahub.index'));
|
||||
|
||||
|
||||
@@ -1,11 +1,22 @@
|
||||
<?php
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
|
||||
uses(RefreshDatabase::class);
|
||||
use App\Models\User;
|
||||
|
||||
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.');
|
||||
|
||||
$user = \App\Models\User::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->get(route('mediahub.networks.index'));
|
||||
|
||||
|
||||
@@ -1,11 +1,23 @@
|
||||
<?php
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
|
||||
uses(RefreshDatabase::class);
|
||||
use App\Models\Person;
|
||||
use App\Models\User;
|
||||
|
||||
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.');
|
||||
|
||||
$user = \App\Models\User::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->get(route('mediahub.persons.index'));
|
||||
|
||||
@@ -18,8 +30,8 @@ test('index returns an ok response', function (): void {
|
||||
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.');
|
||||
|
||||
$person = \App\Models\Person::factory()->create();
|
||||
$user = \App\Models\User::factory()->create();
|
||||
$person = Person::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->get(route('mediahub.persons.show', ['id' => $person->id]));
|
||||
|
||||
|
||||
@@ -1,13 +1,26 @@
|
||||
<?php
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
|
||||
uses(RefreshDatabase::class);
|
||||
use App\Models\Season;
|
||||
use App\Models\Tv;
|
||||
use App\Models\User;
|
||||
|
||||
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.');
|
||||
|
||||
$season = \App\Models\Season::factory()->create();
|
||||
$tv = \App\Models\Tv::factory()->create();
|
||||
$user = \App\Models\User::factory()->create();
|
||||
$season = Season::factory()->create();
|
||||
$tv = Tv::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->get(route('mediahub.season.show', ['id' => $id]));
|
||||
|
||||
|
||||
@@ -1,11 +1,23 @@
|
||||
<?php
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
|
||||
uses(RefreshDatabase::class);
|
||||
use App\Models\Tv;
|
||||
use App\Models\User;
|
||||
|
||||
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.');
|
||||
|
||||
$user = \App\Models\User::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->get(route('mediahub.shows.index'));
|
||||
|
||||
@@ -18,8 +30,8 @@ test('index returns an ok response', function (): void {
|
||||
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.');
|
||||
|
||||
$tv = \App\Models\Tv::factory()->create();
|
||||
$user = \App\Models\User::factory()->create();
|
||||
$tv = Tv::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->get(route('mediahub.shows.show', ['id' => $id]));
|
||||
|
||||
|
||||
@@ -1,11 +1,22 @@
|
||||
<?php
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
|
||||
uses(RefreshDatabase::class);
|
||||
use App\Models\User;
|
||||
|
||||
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.');
|
||||
|
||||
$user = \App\Models\User::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->get(route('missing.index'));
|
||||
|
||||
|
||||
@@ -1,11 +1,26 @@
|
||||
<?php
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
|
||||
uses(RefreshDatabase::class);
|
||||
use App\Models\BlacklistClient;
|
||||
use App\Models\Group;
|
||||
use App\Models\Internal;
|
||||
use App\Models\Page;
|
||||
use App\Models\User;
|
||||
|
||||
test('about 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 = \App\Models\User::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->get(route('about'));
|
||||
|
||||
@@ -18,8 +33,8 @@ test('about returns an ok response', function (): void {
|
||||
test('clientblacklist 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.');
|
||||
|
||||
$blacklistClients = \App\Models\BlacklistClient::factory()->times(3)->create();
|
||||
$user = \App\Models\User::factory()->create();
|
||||
$blacklistClients = BlacklistClient::factory()->times(3)->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->get(route('client_blacklist'));
|
||||
|
||||
@@ -33,8 +48,8 @@ test('clientblacklist returns an ok response', function (): void {
|
||||
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.');
|
||||
|
||||
$pages = \App\Models\Page::factory()->times(3)->create();
|
||||
$user = \App\Models\User::factory()->create();
|
||||
$pages = Page::factory()->times(3)->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->get(route('pages.index'));
|
||||
|
||||
@@ -48,8 +63,8 @@ test('index returns an ok response', function (): void {
|
||||
test('internal 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.');
|
||||
|
||||
$internals = \App\Models\Internal::factory()->times(3)->create();
|
||||
$user = \App\Models\User::factory()->create();
|
||||
$internals = Internal::factory()->times(3)->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->get(route('internal'));
|
||||
|
||||
@@ -63,8 +78,8 @@ test('internal returns an ok response', function (): void {
|
||||
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.');
|
||||
|
||||
$page = \App\Models\Page::factory()->create();
|
||||
$user = \App\Models\User::factory()->create();
|
||||
$page = Page::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->get(route('pages.show', [$page]));
|
||||
|
||||
@@ -78,8 +93,8 @@ test('show returns an ok response', function (): void {
|
||||
test('staff 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.');
|
||||
|
||||
$groups = \App\Models\Group::factory()->times(3)->create();
|
||||
$user = \App\Models\User::factory()->create();
|
||||
$groups = Group::factory()->times(3)->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->get(route('staff'));
|
||||
|
||||
|
||||
@@ -1,11 +1,28 @@
|
||||
<?php
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
|
||||
uses(RefreshDatabase::class);
|
||||
use App\Http\Controllers\PlaylistController;
|
||||
use App\Http\Requests\StorePlaylistRequest;
|
||||
use App\Http\Requests\UpdatePlaylistRequest;
|
||||
use App\Models\Movie;
|
||||
use App\Models\Playlist;
|
||||
use App\Models\Tv;
|
||||
use App\Models\User;
|
||||
|
||||
test('create 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 = \App\Models\User::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->get(route('playlists.create'));
|
||||
|
||||
@@ -18,8 +35,8 @@ test('create returns an ok response', function (): void {
|
||||
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.');
|
||||
|
||||
$playlist = \App\Models\Playlist::factory()->create();
|
||||
$user = \App\Models\User::factory()->create();
|
||||
$playlist = Playlist::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->delete(route('playlists.destroy', [$playlist]));
|
||||
|
||||
@@ -32,8 +49,8 @@ test('destroy returns an ok response', function (): void {
|
||||
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.');
|
||||
|
||||
$playlist = \App\Models\Playlist::factory()->create();
|
||||
$user = \App\Models\User::factory()->create();
|
||||
$playlist = Playlist::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
// TODO: perform additional setup to trigger `abort_unless(403)`...
|
||||
|
||||
@@ -45,8 +62,8 @@ test('destroy aborts with a 403', function (): void {
|
||||
test('edit 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();
|
||||
$playlist = Playlist::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->get(route('playlists.edit', [$playlist]));
|
||||
|
||||
@@ -60,8 +77,8 @@ test('edit returns an ok response', function (): void {
|
||||
test('edit 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();
|
||||
$playlist = Playlist::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
// TODO: perform additional setup to trigger `abort_unless(403)`...
|
||||
|
||||
@@ -73,8 +90,8 @@ test('edit aborts with a 403', function (): void {
|
||||
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.');
|
||||
|
||||
$playlists = \App\Models\Playlist::factory()->times(3)->create();
|
||||
$user = \App\Models\User::factory()->create();
|
||||
$playlists = Playlist::factory()->times(3)->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->get(route('playlists.index'));
|
||||
|
||||
@@ -88,10 +105,10 @@ test('index returns an ok response', function (): void {
|
||||
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.');
|
||||
|
||||
$playlist = \App\Models\Playlist::factory()->create();
|
||||
$tv = \App\Models\Tv::factory()->create();
|
||||
$movie = \App\Models\Movie::factory()->create();
|
||||
$user = \App\Models\User::factory()->create();
|
||||
$playlist = Playlist::factory()->create();
|
||||
$tv = Tv::factory()->create();
|
||||
$movie = Movie::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->get(route('playlists.show', [$playlist]));
|
||||
|
||||
@@ -107,10 +124,10 @@ test('show returns an ok response', function (): void {
|
||||
test('show 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();
|
||||
$tv = \App\Models\Tv::factory()->create();
|
||||
$movie = \App\Models\Movie::factory()->create();
|
||||
$user = \App\Models\User::factory()->create();
|
||||
$playlist = Playlist::factory()->create();
|
||||
$tv = Tv::factory()->create();
|
||||
$movie = Movie::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
// TODO: perform additional setup to trigger `abort_if(403)`...
|
||||
|
||||
@@ -121,16 +138,16 @@ test('show aborts with a 403', function (): void {
|
||||
|
||||
test('store validates with a form request', function (): void {
|
||||
$this->assertActionUsesFormRequest(
|
||||
\App\Http\Controllers\PlaylistController::class,
|
||||
PlaylistController::class,
|
||||
'store',
|
||||
\App\Http\Requests\StorePlaylistRequest::class
|
||||
StorePlaylistRequest::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.');
|
||||
|
||||
$user = \App\Models\User::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->post(route('playlists.store'), [
|
||||
// TODO: send request data
|
||||
@@ -143,17 +160,17 @@ test('store returns an ok response', function (): void {
|
||||
|
||||
test('update validates with a form request', function (): void {
|
||||
$this->assertActionUsesFormRequest(
|
||||
\App\Http\Controllers\PlaylistController::class,
|
||||
PlaylistController::class,
|
||||
'update',
|
||||
\App\Http\Requests\UpdatePlaylistRequest::class
|
||||
UpdatePlaylistRequest::class
|
||||
);
|
||||
});
|
||||
|
||||
test('update 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();
|
||||
$playlist = Playlist::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->patch(route('playlists.update', [$playlist]), [
|
||||
// TODO: send request data
|
||||
@@ -167,8 +184,8 @@ test('update returns an ok response', function (): void {
|
||||
test('update 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();
|
||||
$playlist = Playlist::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
// TODO: perform additional setup to trigger `abort_unless(403)`...
|
||||
|
||||
|
||||
@@ -1,12 +1,28 @@
|
||||
<?php
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
|
||||
uses(RefreshDatabase::class);
|
||||
use App\Http\Controllers\PlaylistTorrentController;
|
||||
use App\Http\Requests\MassUpsertPlaylistTorrentRequest;
|
||||
use App\Http\Requests\StorePlaylistTorrentRequest;
|
||||
use App\Models\Playlist;
|
||||
use App\Models\PlaylistTorrent;
|
||||
use App\Models\User;
|
||||
|
||||
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();
|
||||
$playlistTorrent = PlaylistTorrent::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->delete(route('playlist_torrents.destroy', [$playlistTorrent]));
|
||||
|
||||
@@ -19,8 +35,8 @@ test('destroy returns an ok response', function (): void {
|
||||
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();
|
||||
$playlistTorrent = PlaylistTorrent::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
// TODO: perform additional setup to trigger `abort_unless(403)`...
|
||||
|
||||
@@ -31,17 +47,17 @@ test('destroy aborts with a 403', function (): void {
|
||||
|
||||
test('massupsert validates with a form request', function (): void {
|
||||
$this->assertActionUsesFormRequest(
|
||||
\App\Http\Controllers\PlaylistTorrentController::class,
|
||||
PlaylistTorrentController::class,
|
||||
'massUpsert',
|
||||
\App\Http\Requests\MassUpsertPlaylistTorrentRequest::class
|
||||
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();
|
||||
$playlist = Playlist::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->put(route('playlist_torrents.massUpsert'), [
|
||||
// TODO: send request data
|
||||
@@ -55,8 +71,8 @@ test('mass upsert returns an ok response', function (): void {
|
||||
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();
|
||||
$playlist = Playlist::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
// TODO: perform additional setup to trigger `abort_unless(403)`...
|
||||
|
||||
@@ -69,17 +85,17 @@ test('mass upsert aborts with a 403', function (): void {
|
||||
|
||||
test('store validates with a form request', function (): void {
|
||||
$this->assertActionUsesFormRequest(
|
||||
\App\Http\Controllers\PlaylistTorrentController::class,
|
||||
PlaylistTorrentController::class,
|
||||
'store',
|
||||
\App\Http\Requests\StorePlaylistTorrentRequest::class
|
||||
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();
|
||||
$playlist = Playlist::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->post(route('playlist_torrents.store'), [
|
||||
// TODO: send request data
|
||||
@@ -93,8 +109,8 @@ test('store returns an ok response', function (): void {
|
||||
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();
|
||||
$playlist = Playlist::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
// TODO: perform additional setup to trigger `abort_unless(403)`...
|
||||
|
||||
|
||||
@@ -1,12 +1,24 @@
|
||||
<?php
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
|
||||
uses(RefreshDatabase::class);
|
||||
use App\Models\Playlist;
|
||||
use App\Models\User;
|
||||
|
||||
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.');
|
||||
|
||||
$playlist = \App\Models\Playlist::factory()->create();
|
||||
$user = \App\Models\User::factory()->create();
|
||||
$playlist = Playlist::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->get(route('playlist_zips.show', [$playlist]));
|
||||
|
||||
|
||||
@@ -1,12 +1,24 @@
|
||||
<?php
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
|
||||
uses(RefreshDatabase::class);
|
||||
use App\Models\Poll;
|
||||
use App\Models\User;
|
||||
|
||||
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.');
|
||||
|
||||
$polls = \App\Models\Poll::factory()->times(3)->create();
|
||||
$user = \App\Models\User::factory()->create();
|
||||
$polls = Poll::factory()->times(3)->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->get(route('polls.index'));
|
||||
|
||||
@@ -20,8 +32,8 @@ test('index returns an ok response', function (): void {
|
||||
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.');
|
||||
|
||||
$poll = \App\Models\Poll::factory()->create();
|
||||
$user = \App\Models\User::factory()->create();
|
||||
$poll = Poll::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->get(route('polls.show', [$poll]));
|
||||
|
||||
|
||||
@@ -1,12 +1,26 @@
|
||||
<?php
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
|
||||
uses(RefreshDatabase::class);
|
||||
use App\Http\Controllers\PollVoteController;
|
||||
use App\Http\Requests\StorePollVoteRequest;
|
||||
use App\Models\Poll;
|
||||
use App\Models\User;
|
||||
|
||||
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.');
|
||||
|
||||
$poll = \App\Models\Poll::factory()->create();
|
||||
$user = \App\Models\User::factory()->create();
|
||||
$poll = Poll::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->get(route('polls.votes.index', [$poll]));
|
||||
|
||||
@@ -20,17 +34,17 @@ test('index returns an ok response', function (): void {
|
||||
|
||||
test('store validates with a form request', function (): void {
|
||||
$this->assertActionUsesFormRequest(
|
||||
\App\Http\Controllers\PollVoteController::class,
|
||||
PollVoteController::class,
|
||||
'store',
|
||||
\App\Http\Requests\StorePollVoteRequest::class
|
||||
StorePollVoteRequest::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.');
|
||||
|
||||
$poll = \App\Models\Poll::factory()->create();
|
||||
$user = \App\Models\User::factory()->create();
|
||||
$poll = Poll::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->post(route('polls.votes.store', [$poll]), [
|
||||
// TODO: send request data
|
||||
|
||||
@@ -1,12 +1,25 @@
|
||||
<?php
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
|
||||
uses(RefreshDatabase::class);
|
||||
use App\Models\Post;
|
||||
use App\Models\Topic;
|
||||
use App\Models\User;
|
||||
|
||||
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.');
|
||||
|
||||
$post = \App\Models\Post::factory()->create();
|
||||
$user = \App\Models\User::factory()->create();
|
||||
$post = Post::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->delete(route('posts.destroy', ['id' => $post->id]));
|
||||
|
||||
@@ -19,8 +32,8 @@ test('destroy returns an ok response', function (): void {
|
||||
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.');
|
||||
|
||||
$post = \App\Models\Post::factory()->create();
|
||||
$user = \App\Models\User::factory()->create();
|
||||
$post = Post::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
// TODO: perform additional setup to trigger `abort_unless(403)`...
|
||||
|
||||
@@ -32,8 +45,8 @@ test('destroy aborts with a 403', function (): void {
|
||||
test('edit 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.');
|
||||
|
||||
$post = \App\Models\Post::factory()->create();
|
||||
$user = \App\Models\User::factory()->create();
|
||||
$post = Post::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->get(route('posts.edit', ['id' => $post->id]));
|
||||
|
||||
@@ -50,8 +63,8 @@ test('edit returns an ok response', function (): void {
|
||||
test('edit 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.');
|
||||
|
||||
$post = \App\Models\Post::factory()->create();
|
||||
$user = \App\Models\User::factory()->create();
|
||||
$post = Post::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
// TODO: perform additional setup to trigger `abort_unless(403)`...
|
||||
|
||||
@@ -63,7 +76,7 @@ test('edit aborts with a 403', function (): void {
|
||||
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.');
|
||||
|
||||
$user = \App\Models\User::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->get(route('posts.index'));
|
||||
|
||||
@@ -76,9 +89,9 @@ test('index returns an ok response', function (): void {
|
||||
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.');
|
||||
|
||||
$topic = \App\Models\Topic::factory()->create();
|
||||
$users = \App\Models\User::factory()->times(3)->create();
|
||||
$user = \App\Models\User::factory()->create();
|
||||
$topic = Topic::factory()->create();
|
||||
$users = User::factory()->times(3)->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->post(route('posts.store'), [
|
||||
// TODO: send request data
|
||||
@@ -92,8 +105,8 @@ test('store returns an ok response', function (): void {
|
||||
test('update 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.');
|
||||
|
||||
$post = \App\Models\Post::factory()->create();
|
||||
$user = \App\Models\User::factory()->create();
|
||||
$post = Post::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->patch(route('posts.update', ['id' => $post->id]), [
|
||||
// TODO: send request data
|
||||
@@ -104,34 +117,4 @@ test('update returns an ok response', function (): void {
|
||||
// TODO: perform additional assertions
|
||||
});
|
||||
|
||||
test('update 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.');
|
||||
|
||||
$post = \App\Models\Post::factory()->create();
|
||||
$user = \App\Models\User::factory()->create();
|
||||
|
||||
// TODO: perform additional setup to trigger `abort_unless(403)`...
|
||||
|
||||
$response = $this->actingAs($user)->patch(route('posts.update', ['id' => $post->id]), [
|
||||
// TODO: send request data
|
||||
]);
|
||||
|
||||
$response->assertForbidden();
|
||||
});
|
||||
|
||||
test('update 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.');
|
||||
|
||||
$post = \App\Models\Post::factory()->create();
|
||||
$user = \App\Models\User::factory()->create();
|
||||
|
||||
// TODO: perform additional setup to trigger `abort_unless(403)`...
|
||||
|
||||
$response = $this->actingAs($user)->patch(route('posts.update', ['id' => $post->id]), [
|
||||
// TODO: send request data
|
||||
]);
|
||||
|
||||
$response->assertForbidden();
|
||||
});
|
||||
|
||||
// test cases...
|
||||
|
||||
@@ -1,13 +1,27 @@
|
||||
<?php
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
|
||||
uses(RefreshDatabase::class);
|
||||
use App\Models\Report;
|
||||
use App\Models\Torrent;
|
||||
use App\Models\TorrentRequest;
|
||||
use App\Models\User;
|
||||
|
||||
test('request 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.');
|
||||
|
||||
$torrentRequest = \App\Models\TorrentRequest::factory()->create();
|
||||
$report = \App\Models\Report::factory()->create();
|
||||
$user = \App\Models\User::factory()->create();
|
||||
$torrentRequest = TorrentRequest::factory()->create();
|
||||
$report = Report::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->post(route('report_request', ['id' => $report->id]), [
|
||||
// TODO: send request data
|
||||
@@ -21,9 +35,9 @@ test('request returns an ok response', function (): void {
|
||||
test('torrent 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();
|
||||
$report = \App\Models\Report::factory()->create();
|
||||
$user = \App\Models\User::factory()->create();
|
||||
$torrent = Torrent::factory()->create();
|
||||
$report = Report::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->post(route('report_torrent', ['id' => $report->id]), [
|
||||
// TODO: send request data
|
||||
@@ -37,8 +51,8 @@ test('torrent returns an ok response', function (): void {
|
||||
test('user 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.');
|
||||
|
||||
$report = \App\Models\Report::factory()->create();
|
||||
$user = \App\Models\User::factory()->create();
|
||||
$report = Report::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->post(route('report_user', ['username' => $report->username]), [
|
||||
// TODO: send request data
|
||||
|
||||
@@ -1,15 +1,35 @@
|
||||
<?php
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
|
||||
uses(RefreshDatabase::class);
|
||||
use App\Http\Controllers\RequestController;
|
||||
use App\Http\Requests\StoreTorrentRequestRequest;
|
||||
use App\Http\Requests\UpdateTorrentRequestRequest;
|
||||
use App\Models\Category;
|
||||
use App\Models\Movie;
|
||||
use App\Models\Resolution;
|
||||
use App\Models\TorrentRequest;
|
||||
use App\Models\Tv;
|
||||
use App\Models\Type;
|
||||
use App\Models\User;
|
||||
|
||||
test('create 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();
|
||||
$categories = \App\Models\Category::factory()->times(3)->create();
|
||||
$types = \App\Models\Type::factory()->times(3)->create();
|
||||
$resolutions = \App\Models\Resolution::factory()->times(3)->create();
|
||||
$user = \App\Models\User::factory()->create();
|
||||
$category = Category::factory()->create();
|
||||
$categories = Category::factory()->times(3)->create();
|
||||
$types = Type::factory()->times(3)->create();
|
||||
$resolutions = Resolution::factory()->times(3)->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->get(route('requests.create'));
|
||||
|
||||
@@ -33,8 +53,8 @@ test('create returns an ok response', function (): void {
|
||||
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.');
|
||||
|
||||
$torrentRequest = \App\Models\TorrentRequest::factory()->create();
|
||||
$user = \App\Models\User::factory()->create();
|
||||
$torrentRequest = TorrentRequest::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->delete(route('requests.destroy', [$torrentRequest]));
|
||||
|
||||
@@ -47,8 +67,8 @@ test('destroy returns an ok response', function (): void {
|
||||
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.');
|
||||
|
||||
$torrentRequest = \App\Models\TorrentRequest::factory()->create();
|
||||
$user = \App\Models\User::factory()->create();
|
||||
$torrentRequest = TorrentRequest::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
// TODO: perform additional setup to trigger `abort_unless(403)`...
|
||||
|
||||
@@ -60,11 +80,11 @@ test('destroy aborts with a 403', function (): void {
|
||||
test('edit 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.');
|
||||
|
||||
$torrentRequest = \App\Models\TorrentRequest::factory()->create();
|
||||
$categories = \App\Models\Category::factory()->times(3)->create();
|
||||
$types = \App\Models\Type::factory()->times(3)->create();
|
||||
$resolutions = \App\Models\Resolution::factory()->times(3)->create();
|
||||
$user = \App\Models\User::factory()->create();
|
||||
$torrentRequest = TorrentRequest::factory()->create();
|
||||
$categories = Category::factory()->times(3)->create();
|
||||
$types = Type::factory()->times(3)->create();
|
||||
$resolutions = Resolution::factory()->times(3)->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->get(route('requests.edit', [$torrentRequest]));
|
||||
|
||||
@@ -82,7 +102,7 @@ test('edit returns an ok response', function (): void {
|
||||
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.');
|
||||
|
||||
$user = \App\Models\User::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->get(route('requests.index'));
|
||||
|
||||
@@ -95,10 +115,10 @@ test('index returns an ok response', function (): void {
|
||||
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.');
|
||||
|
||||
$torrentRequest = \App\Models\TorrentRequest::factory()->create();
|
||||
$tv = \App\Models\Tv::factory()->create();
|
||||
$movie = \App\Models\Movie::factory()->create();
|
||||
$user = \App\Models\User::factory()->create();
|
||||
$torrentRequest = TorrentRequest::factory()->create();
|
||||
$tv = Tv::factory()->create();
|
||||
$movie = Movie::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->get(route('requests.show', [$torrentRequest]));
|
||||
|
||||
@@ -113,16 +133,16 @@ test('show returns an ok response', function (): void {
|
||||
|
||||
test('store validates with a form request', function (): void {
|
||||
$this->assertActionUsesFormRequest(
|
||||
\App\Http\Controllers\RequestController::class,
|
||||
RequestController::class,
|
||||
'store',
|
||||
\App\Http\Requests\StoreTorrentRequestRequest::class
|
||||
StoreTorrentRequestRequest::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.');
|
||||
|
||||
$user = \App\Models\User::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->post(route('requests.store'), [
|
||||
// TODO: send request data
|
||||
@@ -135,17 +155,17 @@ test('store returns an ok response', function (): void {
|
||||
|
||||
test('update validates with a form request', function (): void {
|
||||
$this->assertActionUsesFormRequest(
|
||||
\App\Http\Controllers\RequestController::class,
|
||||
RequestController::class,
|
||||
'update',
|
||||
\App\Http\Requests\UpdateTorrentRequestRequest::class
|
||||
UpdateTorrentRequestRequest::class
|
||||
);
|
||||
});
|
||||
|
||||
test('update 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.');
|
||||
|
||||
$torrentRequest = \App\Models\TorrentRequest::factory()->create();
|
||||
$user = \App\Models\User::factory()->create();
|
||||
$torrentRequest = TorrentRequest::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->patch(route('requests.update', [$torrentRequest]), [
|
||||
// TODO: send request data
|
||||
@@ -159,8 +179,8 @@ test('update returns an ok response', function (): void {
|
||||
test('update 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.');
|
||||
|
||||
$torrentRequest = \App\Models\TorrentRequest::factory()->create();
|
||||
$user = \App\Models\User::factory()->create();
|
||||
$torrentRequest = TorrentRequest::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
// TODO: perform additional setup to trigger `abort_unless(403)`...
|
||||
|
||||
|
||||
@@ -1,12 +1,27 @@
|
||||
<?php
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
|
||||
uses(RefreshDatabase::class);
|
||||
use App\Http\Controllers\RequestFillController;
|
||||
use App\Http\Requests\StoreRequestFillRequest;
|
||||
use App\Models\Torrent;
|
||||
use App\Models\TorrentRequest;
|
||||
use App\Models\User;
|
||||
|
||||
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.');
|
||||
|
||||
$torrentRequest = \App\Models\TorrentRequest::factory()->create();
|
||||
$user = \App\Models\User::factory()->create();
|
||||
$torrentRequest = TorrentRequest::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->delete(route('requests.fills.destroy', [$torrentRequest]));
|
||||
|
||||
@@ -19,8 +34,8 @@ test('destroy returns an ok response', function (): void {
|
||||
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.');
|
||||
|
||||
$torrentRequest = \App\Models\TorrentRequest::factory()->create();
|
||||
$user = \App\Models\User::factory()->create();
|
||||
$torrentRequest = TorrentRequest::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
// TODO: perform additional setup to trigger `abort_unless(403)`...
|
||||
|
||||
@@ -31,18 +46,18 @@ test('destroy aborts with a 403', function (): void {
|
||||
|
||||
test('store validates with a form request', function (): void {
|
||||
$this->assertActionUsesFormRequest(
|
||||
\App\Http\Controllers\RequestFillController::class,
|
||||
RequestFillController::class,
|
||||
'store',
|
||||
\App\Http\Requests\StoreRequestFillRequest::class
|
||||
StoreRequestFillRequest::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.');
|
||||
|
||||
$torrentRequest = \App\Models\TorrentRequest::factory()->create();
|
||||
$torrent = \App\Models\Torrent::factory()->create();
|
||||
$user = \App\Models\User::factory()->create();
|
||||
$torrentRequest = TorrentRequest::factory()->create();
|
||||
$torrent = Torrent::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->post(route('requests.fills.store', [$torrentRequest]), [
|
||||
// TODO: send request data
|
||||
|
||||
@@ -1,14 +1,27 @@
|
||||
<?php
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
|
||||
uses(RefreshDatabase::class);
|
||||
use App\Models\History;
|
||||
use App\Models\Torrent;
|
||||
use App\Models\User;
|
||||
|
||||
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.');
|
||||
|
||||
$torrent = \App\Models\Torrent::factory()->create();
|
||||
$user = \App\Models\User::factory()->create();
|
||||
$histories = \App\Models\History::factory()->times(3)->create();
|
||||
$authUser = \App\Models\User::factory()->create();
|
||||
$torrent = Torrent::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
$histories = History::factory()->times(3)->create();
|
||||
$authUser = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($authUser)->post(route('reseed', ['id' => $id]), [
|
||||
// TODO: send request data
|
||||
|
||||
@@ -1,15 +1,32 @@
|
||||
<?php
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
|
||||
uses(RefreshDatabase::class);
|
||||
use App\Models\Category;
|
||||
use App\Models\Genre;
|
||||
use App\Models\Resolution;
|
||||
use App\Models\Rss;
|
||||
use App\Models\Torrent;
|
||||
use App\Models\Type;
|
||||
use App\Models\User;
|
||||
|
||||
test('create 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.');
|
||||
|
||||
$categories = \App\Models\Category::factory()->times(3)->create();
|
||||
$types = \App\Models\Type::factory()->times(3)->create();
|
||||
$resolutions = \App\Models\Resolution::factory()->times(3)->create();
|
||||
$genres = \App\Models\Genre::factory()->times(3)->create();
|
||||
$user = \App\Models\User::factory()->create();
|
||||
$categories = Category::factory()->times(3)->create();
|
||||
$types = Type::factory()->times(3)->create();
|
||||
$resolutions = Resolution::factory()->times(3)->create();
|
||||
$genres = Genre::factory()->times(3)->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->get(route('rss.create'));
|
||||
|
||||
@@ -27,8 +44,8 @@ test('create returns an ok response', function (): void {
|
||||
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.');
|
||||
|
||||
$rss = \App\Models\Rss::factory()->create();
|
||||
$user = \App\Models\User::factory()->create();
|
||||
$rss = Rss::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->delete(route('rss.destroy', ['id' => $rss->id]));
|
||||
|
||||
@@ -41,12 +58,12 @@ test('destroy returns an ok response', function (): void {
|
||||
test('edit 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.');
|
||||
|
||||
$rss = \App\Models\Rss::factory()->create();
|
||||
$categories = \App\Models\Category::factory()->times(3)->create();
|
||||
$types = \App\Models\Type::factory()->times(3)->create();
|
||||
$resolutions = \App\Models\Resolution::factory()->times(3)->create();
|
||||
$genres = \App\Models\Genre::factory()->times(3)->create();
|
||||
$user = \App\Models\User::factory()->create();
|
||||
$rss = Rss::factory()->create();
|
||||
$categories = Category::factory()->times(3)->create();
|
||||
$types = Type::factory()->times(3)->create();
|
||||
$resolutions = Resolution::factory()->times(3)->create();
|
||||
$genres = Genre::factory()->times(3)->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->get(route('rss.edit', ['id' => $rss->id]));
|
||||
|
||||
@@ -65,12 +82,12 @@ test('edit returns an ok response', function (): void {
|
||||
test('edit 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.');
|
||||
|
||||
$rss = \App\Models\Rss::factory()->create();
|
||||
$categories = \App\Models\Category::factory()->times(3)->create();
|
||||
$types = \App\Models\Type::factory()->times(3)->create();
|
||||
$resolutions = \App\Models\Resolution::factory()->times(3)->create();
|
||||
$genres = \App\Models\Genre::factory()->times(3)->create();
|
||||
$user = \App\Models\User::factory()->create();
|
||||
$rss = Rss::factory()->create();
|
||||
$categories = Category::factory()->times(3)->create();
|
||||
$types = Type::factory()->times(3)->create();
|
||||
$resolutions = Resolution::factory()->times(3)->create();
|
||||
$genres = Genre::factory()->times(3)->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
// TODO: perform additional setup to trigger `abort_unless(403)`...
|
||||
|
||||
@@ -82,8 +99,8 @@ test('edit aborts with a 403', function (): void {
|
||||
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.');
|
||||
|
||||
$rsses = \App\Models\Rss::factory()->times(3)->create();
|
||||
$user = \App\Models\User::factory()->create();
|
||||
$rsses = Rss::factory()->times(3)->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->get(route('rss.index'));
|
||||
|
||||
@@ -100,8 +117,8 @@ test('index returns an ok response', function (): void {
|
||||
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.');
|
||||
|
||||
$rss = \App\Models\Rss::factory()->create();
|
||||
$torrents = \App\Models\Torrent::factory()->times(3)->create();
|
||||
$rss = Rss::factory()->create();
|
||||
$torrents = Torrent::factory()->times(3)->create();
|
||||
|
||||
$response = $this->get(route('rss.show.rsskey', ['id' => $rss->id, 'rsskey' => $rss->rsskey]));
|
||||
|
||||
@@ -113,8 +130,8 @@ test('show returns an ok response', function (): void {
|
||||
test('show aborts with a 404', function (): void {
|
||||
$this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.');
|
||||
|
||||
$rss = \App\Models\Rss::factory()->create();
|
||||
$torrents = \App\Models\Torrent::factory()->times(3)->create();
|
||||
$rss = Rss::factory()->create();
|
||||
$torrents = Torrent::factory()->times(3)->create();
|
||||
|
||||
// TODO: perform additional setup to trigger `abort_if(404)`...
|
||||
|
||||
@@ -126,7 +143,7 @@ test('show aborts with a 404', function (): void {
|
||||
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.');
|
||||
|
||||
$user = \App\Models\User::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->post(route('rss.store'), [
|
||||
// TODO: send request data
|
||||
@@ -140,8 +157,8 @@ test('store returns an ok response', function (): void {
|
||||
test('update 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.');
|
||||
|
||||
$rss = \App\Models\Rss::factory()->create();
|
||||
$user = \App\Models\User::factory()->create();
|
||||
$rss = Rss::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->patch(route('rss.update', ['id' => $rss->id]), [
|
||||
// TODO: send request data
|
||||
|
||||
@@ -1,16 +1,33 @@
|
||||
<?php
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
|
||||
uses(RefreshDatabase::class);
|
||||
use App\Models\Category;
|
||||
use App\Models\Movie;
|
||||
use App\Models\Tv;
|
||||
use App\Models\User;
|
||||
|
||||
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.');
|
||||
|
||||
$category = \App\Models\Category::factory()->create();
|
||||
$movie = \App\Models\Movie::factory()->create();
|
||||
$tv = \App\Models\Tv::factory()->create();
|
||||
$user = \App\Models\User::factory()->create();
|
||||
$category = Category::factory()->create();
|
||||
$movie = Movie::factory()->create();
|
||||
$tv = Tv::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->get(route('torrents.similar', ['category_id' => $category_id, 'tmdb' => $tmdb]));
|
||||
$response = $this->actingAs($user)->get(route(
|
||||
'torrents.similar',
|
||||
['category_id' => $category_id, 'tmdb' => $tmdb]
|
||||
));
|
||||
|
||||
$response->assertOk();
|
||||
$response->assertViewIs('torrent.similar');
|
||||
@@ -28,59 +45,17 @@ test('show returns an ok response', function (): void {
|
||||
test('show aborts with a 404', 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();
|
||||
$movie = \App\Models\Movie::factory()->create();
|
||||
$tv = \App\Models\Tv::factory()->create();
|
||||
$user = \App\Models\User::factory()->create();
|
||||
$category = Category::factory()->create();
|
||||
$movie = Movie::factory()->create();
|
||||
$tv = Tv::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
// TODO: perform additional setup to trigger `abort_unless(404)`...
|
||||
|
||||
$response = $this->actingAs($user)->get(route('torrents.similar', ['category_id' => $category_id, 'tmdb' => $tmdb]));
|
||||
|
||||
$response->assertNotFound();
|
||||
});
|
||||
|
||||
test('show aborts with a 404', 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();
|
||||
$movie = \App\Models\Movie::factory()->create();
|
||||
$tv = \App\Models\Tv::factory()->create();
|
||||
$user = \App\Models\User::factory()->create();
|
||||
|
||||
// TODO: perform additional setup to trigger `abort_unless(404)`...
|
||||
|
||||
$response = $this->actingAs($user)->get(route('torrents.similar', ['category_id' => $category_id, 'tmdb' => $tmdb]));
|
||||
|
||||
$response->assertNotFound();
|
||||
});
|
||||
|
||||
test('show aborts with a 404', 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();
|
||||
$movie = \App\Models\Movie::factory()->create();
|
||||
$tv = \App\Models\Tv::factory()->create();
|
||||
$user = \App\Models\User::factory()->create();
|
||||
|
||||
// TODO: perform additional setup to trigger `abort_unless(404)`...
|
||||
|
||||
$response = $this->actingAs($user)->get(route('torrents.similar', ['category_id' => $category_id, 'tmdb' => $tmdb]));
|
||||
|
||||
$response->assertNotFound();
|
||||
});
|
||||
|
||||
test('show aborts with a 404', 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();
|
||||
$movie = \App\Models\Movie::factory()->create();
|
||||
$tv = \App\Models\Tv::factory()->create();
|
||||
$user = \App\Models\User::factory()->create();
|
||||
|
||||
// TODO: perform additional setup to trigger `abort(404)`...
|
||||
|
||||
$response = $this->actingAs($user)->get(route('torrents.similar', ['category_id' => $category_id, 'tmdb' => $tmdb]));
|
||||
$response = $this->actingAs($user)->get(route(
|
||||
'torrents.similar',
|
||||
['category_id' => $category_id, 'tmdb' => $tmdb]
|
||||
));
|
||||
|
||||
$response->assertNotFound();
|
||||
});
|
||||
|
||||
@@ -1,20 +1,35 @@
|
||||
<?php
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
|
||||
uses(RefreshDatabase::class);
|
||||
use App\Http\Controllers\Staff\ApplicationController;
|
||||
use App\Http\Requests\Staff\ApproveApplicationRequest;
|
||||
use App\Http\Requests\Staff\RejectApplicationRequest;
|
||||
use App\Models\Application;
|
||||
use App\Models\User;
|
||||
|
||||
test('approve validates with a form request', function (): void {
|
||||
$this->assertActionUsesFormRequest(
|
||||
\App\Http\Controllers\Staff\ApplicationController::class,
|
||||
ApplicationController::class,
|
||||
'approve',
|
||||
\App\Http\Requests\Staff\ApproveApplicationRequest::class
|
||||
ApproveApplicationRequest::class
|
||||
);
|
||||
});
|
||||
|
||||
test('approve 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.');
|
||||
|
||||
$application = \App\Models\Application::factory()->create();
|
||||
$user = \App\Models\User::factory()->create();
|
||||
$application = Application::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->post(route('staff.applications.approve', ['id' => $application->id]), [
|
||||
// TODO: send request data
|
||||
@@ -28,8 +43,8 @@ test('approve returns an ok response', function (): void {
|
||||
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.');
|
||||
|
||||
$applications = \App\Models\Application::factory()->times(3)->create();
|
||||
$user = \App\Models\User::factory()->create();
|
||||
$applications = Application::factory()->times(3)->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->get(route('staff.applications.index'));
|
||||
|
||||
@@ -42,17 +57,17 @@ test('index returns an ok response', function (): void {
|
||||
|
||||
test('reject validates with a form request', function (): void {
|
||||
$this->assertActionUsesFormRequest(
|
||||
\App\Http\Controllers\Staff\ApplicationController::class,
|
||||
ApplicationController::class,
|
||||
'reject',
|
||||
\App\Http\Requests\Staff\RejectApplicationRequest::class
|
||||
RejectApplicationRequest::class
|
||||
);
|
||||
});
|
||||
|
||||
test('reject 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.');
|
||||
|
||||
$application = \App\Models\Application::factory()->create();
|
||||
$user = \App\Models\User::factory()->create();
|
||||
$application = Application::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->post(route('staff.applications.reject', ['id' => $application->id]), [
|
||||
// TODO: send request data
|
||||
@@ -66,8 +81,8 @@ test('reject returns an ok response', function (): void {
|
||||
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.');
|
||||
|
||||
$application = \App\Models\Application::factory()->create();
|
||||
$user = \App\Models\User::factory()->create();
|
||||
$application = Application::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->get(route('staff.applications.show', ['id' => $application->id]));
|
||||
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
|
||||
namespace Tests\Feature\Http\Controllers\Staff;
|
||||
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use PHPUnit\Framework\Attributes\Test;
|
||||
use App\Models\Article;
|
||||
use App\Models\Group;
|
||||
@@ -19,7 +21,7 @@ final class ArticleControllerTest extends TestCase
|
||||
parent::setUp();
|
||||
}
|
||||
|
||||
protected function createStaffUser(): \Illuminate\Database\Eloquent\Collection|\Illuminate\Database\Eloquent\Model
|
||||
protected function createStaffUser(): Collection|Model
|
||||
{
|
||||
return User::factory()->create([
|
||||
'group_id' => fn () => Group::factory()->create([
|
||||
|
||||
@@ -1,11 +1,26 @@
|
||||
<?php
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
|
||||
uses(RefreshDatabase::class);
|
||||
use App\Http\Controllers\Staff\ArticleController;
|
||||
use App\Http\Requests\Staff\StoreArticleRequest;
|
||||
use App\Http\Requests\Staff\UpdateArticleRequest;
|
||||
use App\Models\Article;
|
||||
use App\Models\User;
|
||||
|
||||
test('create 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 = \App\Models\User::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->get(route('staff.articles.create'));
|
||||
|
||||
@@ -18,8 +33,8 @@ test('create returns an ok response', function (): void {
|
||||
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.');
|
||||
|
||||
$article = \App\Models\Article::factory()->create();
|
||||
$user = \App\Models\User::factory()->create();
|
||||
$article = Article::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->delete(route('staff.articles.destroy', [$article]));
|
||||
|
||||
@@ -32,8 +47,8 @@ test('destroy returns an ok response', function (): void {
|
||||
test('edit 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.');
|
||||
|
||||
$article = \App\Models\Article::factory()->create();
|
||||
$user = \App\Models\User::factory()->create();
|
||||
$article = Article::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->get(route('staff.articles.edit', [$article]));
|
||||
|
||||
@@ -47,8 +62,8 @@ test('edit returns an ok response', function (): void {
|
||||
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.');
|
||||
|
||||
$articles = \App\Models\Article::factory()->times(3)->create();
|
||||
$user = \App\Models\User::factory()->create();
|
||||
$articles = Article::factory()->times(3)->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->get(route('staff.articles.index'));
|
||||
|
||||
@@ -61,16 +76,16 @@ test('index returns an ok response', function (): void {
|
||||
|
||||
test('store validates with a form request', function (): void {
|
||||
$this->assertActionUsesFormRequest(
|
||||
\App\Http\Controllers\Staff\ArticleController::class,
|
||||
ArticleController::class,
|
||||
'store',
|
||||
\App\Http\Requests\Staff\StoreArticleRequest::class
|
||||
StoreArticleRequest::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.');
|
||||
|
||||
$user = \App\Models\User::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->post(route('staff.articles.store'), [
|
||||
// TODO: send request data
|
||||
@@ -83,17 +98,17 @@ test('store returns an ok response', function (): void {
|
||||
|
||||
test('update validates with a form request', function (): void {
|
||||
$this->assertActionUsesFormRequest(
|
||||
\App\Http\Controllers\Staff\ArticleController::class,
|
||||
ArticleController::class,
|
||||
'update',
|
||||
\App\Http\Requests\Staff\UpdateArticleRequest::class
|
||||
UpdateArticleRequest::class
|
||||
);
|
||||
});
|
||||
|
||||
test('update 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.');
|
||||
|
||||
$article = \App\Models\Article::factory()->create();
|
||||
$user = \App\Models\User::factory()->create();
|
||||
$article = Article::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->post(route('staff.articles.update', [$article]), [
|
||||
// TODO: send request data
|
||||
|
||||
@@ -1,12 +1,24 @@
|
||||
<?php
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
|
||||
uses(RefreshDatabase::class);
|
||||
use App\Models\Audit;
|
||||
use App\Models\User;
|
||||
|
||||
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.');
|
||||
|
||||
$audit = \App\Models\Audit::factory()->create();
|
||||
$user = \App\Models\User::factory()->create();
|
||||
$audit = Audit::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->delete(route('staff.audits.destroy', [$audit]));
|
||||
|
||||
@@ -19,7 +31,7 @@ test('destroy returns an ok response', function (): void {
|
||||
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.');
|
||||
|
||||
$user = \App\Models\User::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->get(route('staff.audits.index'));
|
||||
|
||||
|
||||
@@ -1,11 +1,22 @@
|
||||
<?php
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
|
||||
uses(RefreshDatabase::class);
|
||||
use App\Models\User;
|
||||
|
||||
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.');
|
||||
|
||||
$user = \App\Models\User::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->get(route('staff.authentications.index'));
|
||||
|
||||
|
||||
@@ -1,11 +1,22 @@
|
||||
<?php
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
|
||||
uses(RefreshDatabase::class);
|
||||
use App\Models\User;
|
||||
|
||||
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.');
|
||||
|
||||
$user = \App\Models\User::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->get(route('staff.backups.index'));
|
||||
|
||||
|
||||
@@ -1,12 +1,26 @@
|
||||
<?php
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
|
||||
uses(RefreshDatabase::class);
|
||||
use App\Http\Controllers\Staff\BanController;
|
||||
use App\Http\Requests\Staff\StoreBanRequest;
|
||||
use App\Models\Ban;
|
||||
use App\Models\User;
|
||||
|
||||
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.');
|
||||
|
||||
$bans = \App\Models\Ban::factory()->times(3)->create();
|
||||
$user = \App\Models\User::factory()->create();
|
||||
$bans = Ban::factory()->times(3)->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->get(route('staff.bans.index'));
|
||||
|
||||
@@ -19,17 +33,17 @@ test('index returns an ok response', function (): void {
|
||||
|
||||
test('store validates with a form request', function (): void {
|
||||
$this->assertActionUsesFormRequest(
|
||||
\App\Http\Controllers\Staff\BanController::class,
|
||||
BanController::class,
|
||||
'store',
|
||||
\App\Http\Requests\Staff\StoreBanRequest::class
|
||||
StoreBanRequest::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.');
|
||||
|
||||
$user = \App\Models\User::factory()->create();
|
||||
$authUser = \App\Models\User::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
$authUser = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($authUser)->post(route('staff.bans.store'), [
|
||||
// TODO: send request data
|
||||
@@ -43,8 +57,8 @@ test('store returns an ok response', function (): void {
|
||||
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.');
|
||||
|
||||
$user = \App\Models\User::factory()->create();
|
||||
$authUser = \App\Models\User::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
$authUser = User::factory()->create();
|
||||
|
||||
// TODO: perform additional setup to trigger `abort_if(403)`...
|
||||
|
||||
|
||||
@@ -1,11 +1,26 @@
|
||||
<?php
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
|
||||
uses(RefreshDatabase::class);
|
||||
use App\Http\Controllers\Staff\BlacklistClientController;
|
||||
use App\Http\Requests\Staff\StoreBlacklistClientRequest;
|
||||
use App\Http\Requests\Staff\UpdateBlacklistClientRequest;
|
||||
use App\Models\BlacklistClient;
|
||||
use App\Models\User;
|
||||
|
||||
test('create 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 = \App\Models\User::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->get(route('staff.blacklisted_clients.create'));
|
||||
|
||||
@@ -18,8 +33,8 @@ test('create returns an ok response', function (): void {
|
||||
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.');
|
||||
|
||||
$blacklistClient = \App\Models\BlacklistClient::factory()->create();
|
||||
$user = \App\Models\User::factory()->create();
|
||||
$blacklistClient = BlacklistClient::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->delete(route('staff.blacklisted_clients.destroy', [$blacklistClient]));
|
||||
|
||||
@@ -32,8 +47,8 @@ test('destroy returns an ok response', function (): void {
|
||||
test('edit 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.');
|
||||
|
||||
$blacklistClient = \App\Models\BlacklistClient::factory()->create();
|
||||
$user = \App\Models\User::factory()->create();
|
||||
$blacklistClient = BlacklistClient::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->get(route('staff.blacklisted_clients.edit', [$blacklistClient]));
|
||||
|
||||
@@ -47,8 +62,8 @@ test('edit returns an ok response', function (): void {
|
||||
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.');
|
||||
|
||||
$blacklistClients = \App\Models\BlacklistClient::factory()->times(3)->create();
|
||||
$user = \App\Models\User::factory()->create();
|
||||
$blacklistClients = BlacklistClient::factory()->times(3)->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->get(route('staff.blacklisted_clients.index'));
|
||||
|
||||
@@ -61,16 +76,16 @@ test('index returns an ok response', function (): void {
|
||||
|
||||
test('store validates with a form request', function (): void {
|
||||
$this->assertActionUsesFormRequest(
|
||||
\App\Http\Controllers\Staff\BlacklistClientController::class,
|
||||
BlacklistClientController::class,
|
||||
'store',
|
||||
\App\Http\Requests\Staff\StoreBlacklistClientRequest::class
|
||||
StoreBlacklistClientRequest::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.');
|
||||
|
||||
$user = \App\Models\User::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->post(route('staff.blacklisted_clients.store'), [
|
||||
// TODO: send request data
|
||||
@@ -83,17 +98,17 @@ test('store returns an ok response', function (): void {
|
||||
|
||||
test('update validates with a form request', function (): void {
|
||||
$this->assertActionUsesFormRequest(
|
||||
\App\Http\Controllers\Staff\BlacklistClientController::class,
|
||||
BlacklistClientController::class,
|
||||
'update',
|
||||
\App\Http\Requests\Staff\UpdateBlacklistClientRequest::class
|
||||
UpdateBlacklistClientRequest::class
|
||||
);
|
||||
});
|
||||
|
||||
test('update 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.');
|
||||
|
||||
$blacklistClient = \App\Models\BlacklistClient::factory()->create();
|
||||
$user = \App\Models\User::factory()->create();
|
||||
$blacklistClient = BlacklistClient::factory()->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->patch(route('staff.blacklisted_clients.update', [$blacklistClient]), [
|
||||
// TODO: send request data
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user