diff --git a/composer.json b/composer.json index d18697308..9524a7ebc 100644 --- a/composer.json +++ b/composer.json @@ -52,7 +52,9 @@ "pestphp/pest-plugin-laravel": "^2.0", "pestphp/pest-plugin-livewire": "^2.0", "phpunit/phpunit": "10.2.3", - "spatie/laravel-ignition": "^2.2" + "spatie/laravel-ignition": "^2.2", + "jasonmccreary/laravel-test-assertions": "^2.3", + "laravel-shift/factory-generator": "dev-master" }, "config": { "preferred-install": "dist", diff --git a/composer.lock b/composer.lock index 6edb9f57a..90faa595a 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "ee23bca7ba5ecee28be962a5b0375b74", + "content-hash": "cc118cb19b45223e08f2a9859a03802e", "packages": [ { "name": "assada/laravel-achievements", @@ -8538,6 +8538,56 @@ }, "time": "2020-07-09T08:09:16+00:00" }, + { + "name": "jasonmccreary/laravel-test-assertions", + "version": "v2.3", + "source": { + "type": "git", + "url": "https://github.com/jasonmccreary/laravel-test-assertions.git", + "reference": "77d1812dce4438c294e281acade9d52adf4ce0a0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/jasonmccreary/laravel-test-assertions/zipball/77d1812dce4438c294e281acade9d52adf4ce0a0", + "reference": "77d1812dce4438c294e281acade9d52adf4ce0a0", + "shasum": "" + }, + "require": { + "illuminate/testing": "^9.0|^10.0", + "mockery/mockery": "^1.4.2", + "php": "^8.0", + "phpunit/phpunit": "^9.3.3|^10.0" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "JMac\\Testing\\AdditionalAssertionsServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "JMac\\Testing\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jason McCreary", + "email": "jason@pureconcepts.net" + } + ], + "description": "A set of helpful assertions when testing Laravel applications.", + "support": { + "issues": "https://github.com/jasonmccreary/laravel-test-assertions/issues", + "source": "https://github.com/jasonmccreary/laravel-test-assertions/tree/v2.3" + }, + "time": "2023-03-15T16:29:35+00:00" + }, { "name": "jean85/pretty-package-versions", "version": "2.0.5", @@ -8597,6 +8647,60 @@ }, "time": "2021-10-08T21:21:46+00:00" }, + { + "name": "laravel-shift/factory-generator", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/laravel-shift/factory-generator.git", + "reference": "63903d5fccfb5f85ae31dba1937ad3cd4bd83112" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laravel-shift/factory-generator/zipball/63903d5fccfb5f85ae31dba1937ad3cd4bd83112", + "reference": "63903d5fccfb5f85ae31dba1937ad3cd4bd83112", + "shasum": "" + }, + "require": { + "fakerphp/faker": "^1.9.1", + "illuminate/support": "^9.0|^10.0", + "naoray/eloquent-model-analyzer": "^3.0|^4.0", + "nikic/php-parser": "^4.15" + }, + "require-dev": { + "orchestra/testbench": "^7.0|^8.0" + }, + "default-branch": true, + "type": "package", + "extra": { + "laravel": { + "providers": [ + "Shift\\FactoryGenerator\\FactoryGeneratorServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "Shift\\FactoryGenerator\\": "./src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Generate factories from existing models", + "keywords": [ + "factory", + "laravel", + "model", + "testing" + ], + "support": { + "issues": "https://github.com/laravel-shift/factory-generator/issues", + "source": "https://github.com/laravel-shift/factory-generator/tree/master" + }, + "time": "2023-03-09T16:47:45+00:00" + }, { "name": "laravel/pint", "version": "v1.10.4", @@ -8865,6 +8969,57 @@ ], "time": "2023-03-08T13:26:56+00:00" }, + { + "name": "naoray/eloquent-model-analyzer", + "version": "v4.0.0", + "source": { + "type": "git", + "url": "https://github.com/Naoray/eloquent-model-analyzer.git", + "reference": "cdc4639a06250e94b85122fa3e17952a560c2427" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Naoray/eloquent-model-analyzer/zipball/cdc4639a06250e94b85122fa3e17952a560c2427", + "reference": "cdc4639a06250e94b85122fa3e17952a560c2427", + "shasum": "" + }, + "require": { + "doctrine/dbal": "^2.6|^3.0", + "illuminate/database": "^8.40.0|^9.0|^10.0", + "illuminate/support": "^8.24.0|^9.0|^10.0" + }, + "require-dev": { + "orchestra/testbench": "^6.0|^7.0|^8.0" + }, + "type": "pakage", + "autoload": { + "psr-4": { + "Naoray\\EloquentModelAnalyzer\\": "./src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Krishan Koenig", + "email": "krishan.koenig@googlemail.com" + } + ], + "description": "Helpful methods to gain more information about eloquent model classes.", + "support": { + "issues": "https://github.com/Naoray/eloquent-model-analyzer/issues", + "source": "https://github.com/Naoray/eloquent-model-analyzer/tree/v4.0.0" + }, + "funding": [ + { + "url": "https://github.com/naoray", + "type": "github" + } + ], + "time": "2023-02-20T17:07:18+00:00" + }, { "name": "nunomaduro/collision", "version": "v7.7.0", @@ -11476,7 +11631,8 @@ "aliases": [], "minimum-stability": "stable", "stability-flags": { - "theodorejb/polycast": 20 + "theodorejb/polycast": 20, + "laravel-shift/factory-generator": 20 }, "prefer-stable": true, "prefer-lowest": false, diff --git a/phpunit.xml b/phpunit.xml index 5860d14b4..ba380bcf7 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -19,7 +19,9 @@ --> - + + + diff --git a/tests/Feature/Console/Commands/AutoBanDisposableUsersTest.php b/tests/Feature/Console/Commands/AutoBanDisposableUsersTest.php new file mode 100644 index 000000000..acf1f3991 --- /dev/null +++ b/tests/Feature/Console/Commands/AutoBanDisposableUsersTest.php @@ -0,0 +1,14 @@ +markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $this->artisan('auto:ban_disposable_users') + ->assertExitCode(0) + ->run(); + + // TODO: perform additional assertions to ensure the command behaved as expected +}); diff --git a/tests/Feature/Console/Commands/AutoBonAllocationTest.php b/tests/Feature/Console/Commands/AutoBonAllocationTest.php new file mode 100644 index 000000000..e0f543066 --- /dev/null +++ b/tests/Feature/Console/Commands/AutoBonAllocationTest.php @@ -0,0 +1,14 @@ +markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $this->artisan('auto:bon_allocation') + ->assertExitCode(0) + ->run(); + + // TODO: perform additional assertions to ensure the command behaved as expected +}); diff --git a/tests/Feature/Console/Commands/AutoCorrectHistoryTest.php b/tests/Feature/Console/Commands/AutoCorrectHistoryTest.php new file mode 100644 index 000000000..7daf5e1eb --- /dev/null +++ b/tests/Feature/Console/Commands/AutoCorrectHistoryTest.php @@ -0,0 +1,14 @@ +markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $this->artisan('auto:correct_history') + ->assertExitCode(0) + ->run(); + + // TODO: perform additional assertions to ensure the command behaved as expected +}); diff --git a/tests/Feature/Console/Commands/AutoDeactivateWarningTest.php b/tests/Feature/Console/Commands/AutoDeactivateWarningTest.php new file mode 100644 index 000000000..a53e25cbc --- /dev/null +++ b/tests/Feature/Console/Commands/AutoDeactivateWarningTest.php @@ -0,0 +1,14 @@ +markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $this->artisan('auto:deactivate_warning') + ->assertExitCode(0) + ->run(); + + // TODO: perform additional assertions to ensure the command behaved as expected +}); diff --git a/tests/Feature/Console/Commands/AutoDisableInactiveUsersTest.php b/tests/Feature/Console/Commands/AutoDisableInactiveUsersTest.php new file mode 100644 index 000000000..050f97925 --- /dev/null +++ b/tests/Feature/Console/Commands/AutoDisableInactiveUsersTest.php @@ -0,0 +1,14 @@ +markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $this->artisan('auto:disable_inactive_users') + ->assertExitCode(0) + ->run(); + + // TODO: perform additional assertions to ensure the command behaved as expected +}); diff --git a/tests/Feature/Console/Commands/AutoFlushPeersTest.php b/tests/Feature/Console/Commands/AutoFlushPeersTest.php new file mode 100644 index 000000000..7b1334d34 --- /dev/null +++ b/tests/Feature/Console/Commands/AutoFlushPeersTest.php @@ -0,0 +1,14 @@ +markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $this->artisan('auto:flush_peers') + ->assertExitCode(0) + ->run(); + + // TODO: perform additional assertions to ensure the command behaved as expected +}); diff --git a/tests/Feature/Console/Commands/AutoGraveyardTest.php b/tests/Feature/Console/Commands/AutoGraveyardTest.php new file mode 100644 index 000000000..04f9d4947 --- /dev/null +++ b/tests/Feature/Console/Commands/AutoGraveyardTest.php @@ -0,0 +1,14 @@ +markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $this->artisan('auto:graveyard') + ->assertExitCode(0) + ->run(); + + // TODO: perform additional assertions to ensure the command behaved as expected +}); diff --git a/tests/Feature/Console/Commands/AutoGroupTest.php b/tests/Feature/Console/Commands/AutoGroupTest.php new file mode 100644 index 000000000..b2df51836 --- /dev/null +++ b/tests/Feature/Console/Commands/AutoGroupTest.php @@ -0,0 +1,14 @@ +markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $this->artisan('auto:group') + ->assertExitCode(0) + ->run(); + + // TODO: perform additional assertions to ensure the command behaved as expected +}); diff --git a/tests/Feature/Console/Commands/AutoHighspeedTagTest.php b/tests/Feature/Console/Commands/AutoHighspeedTagTest.php new file mode 100644 index 000000000..bc7cddeb8 --- /dev/null +++ b/tests/Feature/Console/Commands/AutoHighspeedTagTest.php @@ -0,0 +1,14 @@ +markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $this->artisan('auto:highspeed_tag') + ->assertExitCode(0) + ->run(); + + // TODO: perform additional assertions to ensure the command behaved as expected +}); diff --git a/tests/Feature/Console/Commands/AutoNerdStatTest.php b/tests/Feature/Console/Commands/AutoNerdStatTest.php new file mode 100644 index 000000000..c283c086f --- /dev/null +++ b/tests/Feature/Console/Commands/AutoNerdStatTest.php @@ -0,0 +1,14 @@ +markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $this->artisan('auto:nerdstat') + ->assertExitCode(0) + ->run(); + + // TODO: perform additional assertions to ensure the command behaved as expected +}); diff --git a/tests/Feature/Console/Commands/AutoPreWarningTest.php b/tests/Feature/Console/Commands/AutoPreWarningTest.php new file mode 100644 index 000000000..bc4c0a648 --- /dev/null +++ b/tests/Feature/Console/Commands/AutoPreWarningTest.php @@ -0,0 +1,14 @@ +markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $this->artisan('auto:prewarning') + ->assertExitCode(0) + ->run(); + + // TODO: perform additional assertions to ensure the command behaved as expected +}); diff --git a/tests/Feature/Console/Commands/AutoRecycleAuditsTest.php b/tests/Feature/Console/Commands/AutoRecycleAuditsTest.php new file mode 100644 index 000000000..dee837315 --- /dev/null +++ b/tests/Feature/Console/Commands/AutoRecycleAuditsTest.php @@ -0,0 +1,14 @@ +markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $this->artisan('auto:recycle_activity_log') + ->assertExitCode(0) + ->run(); + + // TODO: perform additional assertions to ensure the command behaved as expected +}); diff --git a/tests/Feature/Console/Commands/AutoRecycleClaimedTorrentRequestsTest.php b/tests/Feature/Console/Commands/AutoRecycleClaimedTorrentRequestsTest.php new file mode 100644 index 000000000..f00d21ff0 --- /dev/null +++ b/tests/Feature/Console/Commands/AutoRecycleClaimedTorrentRequestsTest.php @@ -0,0 +1,14 @@ +markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $this->artisan('auto:recycle_claimed_torrent_requests') + ->assertExitCode(0) + ->run(); + + // TODO: perform additional assertions to ensure the command behaved as expected +}); diff --git a/tests/Feature/Console/Commands/AutoRecycleFailedLoginsTest.php b/tests/Feature/Console/Commands/AutoRecycleFailedLoginsTest.php new file mode 100644 index 000000000..9594a6ab8 --- /dev/null +++ b/tests/Feature/Console/Commands/AutoRecycleFailedLoginsTest.php @@ -0,0 +1,14 @@ +markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $this->artisan('auto:recycle_failed_logins') + ->assertExitCode(0) + ->run(); + + // TODO: perform additional assertions to ensure the command behaved as expected +}); diff --git a/tests/Feature/Console/Commands/AutoRecycleInvitesTest.php b/tests/Feature/Console/Commands/AutoRecycleInvitesTest.php new file mode 100644 index 000000000..88f18f756 --- /dev/null +++ b/tests/Feature/Console/Commands/AutoRecycleInvitesTest.php @@ -0,0 +1,14 @@ +markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $this->artisan('auto:recycle_invites') + ->assertExitCode(0) + ->run(); + + // TODO: perform additional assertions to ensure the command behaved as expected +}); diff --git a/tests/Feature/Console/Commands/AutoRefundDownloadTest.php b/tests/Feature/Console/Commands/AutoRefundDownloadTest.php new file mode 100644 index 000000000..7364f38dc --- /dev/null +++ b/tests/Feature/Console/Commands/AutoRefundDownloadTest.php @@ -0,0 +1,14 @@ +markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $this->artisan('auto:refund_download') + ->assertExitCode(0) + ->run(); + + // TODO: perform additional assertions to ensure the command behaved as expected +}); diff --git a/tests/Feature/Console/Commands/AutoRemoveFeaturedTorrentTest.php b/tests/Feature/Console/Commands/AutoRemoveFeaturedTorrentTest.php new file mode 100644 index 000000000..13e8f73a8 --- /dev/null +++ b/tests/Feature/Console/Commands/AutoRemoveFeaturedTorrentTest.php @@ -0,0 +1,14 @@ +markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $this->artisan('auto:remove_featured_torrent') + ->assertExitCode(0) + ->run(); + + // TODO: perform additional assertions to ensure the command behaved as expected +}); diff --git a/tests/Feature/Console/Commands/AutoRemovePersonalFreeleechTest.php b/tests/Feature/Console/Commands/AutoRemovePersonalFreeleechTest.php new file mode 100644 index 000000000..f7f1579ba --- /dev/null +++ b/tests/Feature/Console/Commands/AutoRemovePersonalFreeleechTest.php @@ -0,0 +1,14 @@ +markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $this->artisan('auto:remove_personal_freeleech') + ->assertExitCode(0) + ->run(); + + // TODO: perform additional assertions to ensure the command behaved as expected +}); diff --git a/tests/Feature/Console/Commands/AutoRemoveTimedTorrentBuffsTest.php b/tests/Feature/Console/Commands/AutoRemoveTimedTorrentBuffsTest.php new file mode 100644 index 000000000..34aa891d7 --- /dev/null +++ b/tests/Feature/Console/Commands/AutoRemoveTimedTorrentBuffsTest.php @@ -0,0 +1,14 @@ +markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $this->artisan('auto:remove_torrent_buffs') + ->assertExitCode(0) + ->run(); + + // TODO: perform additional assertions to ensure the command behaved as expected +}); diff --git a/tests/Feature/Console/Commands/AutoResetUserFlushesTest.php b/tests/Feature/Console/Commands/AutoResetUserFlushesTest.php new file mode 100644 index 000000000..40639a90b --- /dev/null +++ b/tests/Feature/Console/Commands/AutoResetUserFlushesTest.php @@ -0,0 +1,14 @@ +markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $this->artisan('auto:reset_user_flushes') + ->assertExitCode(0) + ->run(); + + // TODO: perform additional assertions to ensure the command behaved as expected +}); diff --git a/tests/Feature/Console/Commands/AutoSoftDeleteDisabledUsersTest.php b/tests/Feature/Console/Commands/AutoSoftDeleteDisabledUsersTest.php new file mode 100644 index 000000000..167316449 --- /dev/null +++ b/tests/Feature/Console/Commands/AutoSoftDeleteDisabledUsersTest.php @@ -0,0 +1,14 @@ +markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $this->artisan('auto:softdelete_disabled_users') + ->assertExitCode(0) + ->run(); + + // TODO: perform additional assertions to ensure the command behaved as expected +}); diff --git a/tests/Feature/Console/Commands/AutoStatsClientsTest.php b/tests/Feature/Console/Commands/AutoStatsClientsTest.php new file mode 100644 index 000000000..9feb2d32a --- /dev/null +++ b/tests/Feature/Console/Commands/AutoStatsClientsTest.php @@ -0,0 +1,14 @@ +markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $this->artisan('auto:stats_clients') + ->assertExitCode(0) + ->run(); + + // TODO: perform additional assertions to ensure the command behaved as expected +}); diff --git a/tests/Feature/Console/Commands/AutoTorrentBalanceTest.php b/tests/Feature/Console/Commands/AutoTorrentBalanceTest.php new file mode 100644 index 000000000..c383795e7 --- /dev/null +++ b/tests/Feature/Console/Commands/AutoTorrentBalanceTest.php @@ -0,0 +1,14 @@ +markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $this->artisan('auto:torrent_balance') + ->assertExitCode(0) + ->run(); + + // TODO: perform additional assertions to ensure the command behaved as expected +}); diff --git a/tests/Feature/Console/Commands/AutoWarningTest.php b/tests/Feature/Console/Commands/AutoWarningTest.php new file mode 100644 index 000000000..66a3dca44 --- /dev/null +++ b/tests/Feature/Console/Commands/AutoWarningTest.php @@ -0,0 +1,14 @@ +markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $this->artisan('auto:warning') + ->assertExitCode(0) + ->run(); + + // TODO: perform additional assertions to ensure the command behaved as expected +}); diff --git a/tests/Feature/Console/Commands/CheckForStaleTicketsTest.php b/tests/Feature/Console/Commands/CheckForStaleTicketsTest.php new file mode 100644 index 000000000..d6e526cfb --- /dev/null +++ b/tests/Feature/Console/Commands/CheckForStaleTicketsTest.php @@ -0,0 +1,14 @@ +markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $this->artisan('tickets:stale') + ->assertExitCode(0) + ->run(); + + // TODO: perform additional assertions to ensure the command behaved as expected +}); diff --git a/tests/Feature/Console/Commands/ClearCacheTest.php b/tests/Feature/Console/Commands/ClearCacheTest.php new file mode 100644 index 000000000..c1979bb37 --- /dev/null +++ b/tests/Feature/Console/Commands/ClearCacheTest.php @@ -0,0 +1,14 @@ +markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $this->artisan('clear:all_cache') + ->assertExitCode(0) + ->run(); + + // TODO: perform additional assertions to ensure the command behaved as expected +}); diff --git a/tests/Feature/Console/Commands/DbDumpTest.php b/tests/Feature/Console/Commands/DbDumpTest.php new file mode 100644 index 000000000..8f5d30248 --- /dev/null +++ b/tests/Feature/Console/Commands/DbDumpTest.php @@ -0,0 +1,14 @@ +markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $this->artisan('db:dump') + ->assertExitCode(0) + ->run(); + + // TODO: perform additional assertions to ensure the command behaved as expected +}); diff --git a/tests/Feature/Console/Commands/DbLoadTest.php b/tests/Feature/Console/Commands/DbLoadTest.php new file mode 100644 index 000000000..c77482a7f --- /dev/null +++ b/tests/Feature/Console/Commands/DbLoadTest.php @@ -0,0 +1,14 @@ +markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $this->artisan('db:load') + ->assertExitCode(0) + ->run(); + + // TODO: perform additional assertions to ensure the command behaved as expected +}); diff --git a/tests/Feature/Console/Commands/EmailBlacklistUpdateTest.php b/tests/Feature/Console/Commands/EmailBlacklistUpdateTest.php new file mode 100644 index 000000000..19e8d2bef --- /dev/null +++ b/tests/Feature/Console/Commands/EmailBlacklistUpdateTest.php @@ -0,0 +1,14 @@ +markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $this->artisan('auto:email-blacklist-update') + ->assertExitCode(0) + ->run(); + + // TODO: perform additional assertions to ensure the command behaved as expected +}); diff --git a/tests/Feature/Console/Commands/FetchReleaseYearsTest.php b/tests/Feature/Console/Commands/FetchReleaseYearsTest.php new file mode 100644 index 000000000..2262ae8d1 --- /dev/null +++ b/tests/Feature/Console/Commands/FetchReleaseYearsTest.php @@ -0,0 +1,14 @@ +markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $this->artisan('fetch:release_years') + ->assertExitCode(0) + ->run(); + + // TODO: perform additional assertions to ensure the command behaved as expected +}); diff --git a/tests/Feature/Console/Commands/GitUpdaterTest.php b/tests/Feature/Console/Commands/GitUpdaterTest.php new file mode 100644 index 000000000..63b197c45 --- /dev/null +++ b/tests/Feature/Console/Commands/GitUpdaterTest.php @@ -0,0 +1,14 @@ +markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $this->artisan('git:update') + ->assertExitCode(0) + ->run(); + + // TODO: perform additional assertions to ensure the command behaved as expected +}); diff --git a/tests/Feature/Console/Commands/SetCacheTest.php b/tests/Feature/Console/Commands/SetCacheTest.php new file mode 100644 index 000000000..20a8339b7 --- /dev/null +++ b/tests/Feature/Console/Commands/SetCacheTest.php @@ -0,0 +1,14 @@ +markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $this->artisan('set:all_cache') + ->assertExitCode(0) + ->run(); + + // TODO: perform additional assertions to ensure the command behaved as expected +}); diff --git a/tests/Feature/Console/Commands/SyncPeersTest.php b/tests/Feature/Console/Commands/SyncPeersTest.php new file mode 100644 index 000000000..93983c43c --- /dev/null +++ b/tests/Feature/Console/Commands/SyncPeersTest.php @@ -0,0 +1,14 @@ +markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $this->artisan('auto:sync_peers') + ->assertExitCode(0) + ->run(); + + // TODO: perform additional assertions to ensure the command behaved as expected +}); diff --git a/tests/Feature/Console/Commands/SyncTorrentSeasonEpisodeTest.php b/tests/Feature/Console/Commands/SyncTorrentSeasonEpisodeTest.php new file mode 100644 index 000000000..f1406f37b --- /dev/null +++ b/tests/Feature/Console/Commands/SyncTorrentSeasonEpisodeTest.php @@ -0,0 +1,14 @@ +markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $this->artisan('auto:sync_torrent_season_episode') + ->assertExitCode(0) + ->run(); + + // TODO: perform additional assertions to ensure the command behaved as expected +}); diff --git a/tests/Feature/Console/Commands/TestMailSettingsTest.php b/tests/Feature/Console/Commands/TestMailSettingsTest.php new file mode 100644 index 000000000..9e823b3b3 --- /dev/null +++ b/tests/Feature/Console/Commands/TestMailSettingsTest.php @@ -0,0 +1,14 @@ +markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $this->artisan('test:email') + ->assertExitCode(0) + ->run(); + + // TODO: perform additional assertions to ensure the command behaved as expected +}); diff --git a/tests/Feature/Console/Commands/VendorCleanupTest.php b/tests/Feature/Console/Commands/VendorCleanupTest.php new file mode 100644 index 000000000..7decbdf60 --- /dev/null +++ b/tests/Feature/Console/Commands/VendorCleanupTest.php @@ -0,0 +1,14 @@ +markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $this->artisan('vendor:cleanup') + ->assertExitCode(0) + ->run(); + + // TODO: perform additional assertions to ensure the command behaved as expected +}); diff --git a/tests/Feature/Http/Controllers/API/ChatControllerTest.php b/tests/Feature/Http/Controllers/API/ChatControllerTest.php new file mode 100644 index 000000000..1cf27039e --- /dev/null +++ b/tests/Feature/Http/Controllers/API/ChatControllerTest.php @@ -0,0 +1,289 @@ +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)->get('api/chat/audibles'); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +test('bot messages returns an ok response', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $bot = \App\Models\Bot::factory()->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->get('api/chat/bot/{bot_id}'); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +test('bots returns an ok response', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->get('api/chat/bots'); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +test('config returns an ok response', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->get('api/chat/config'); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +test('create message returns an ok response', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $bots = \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(); + + $response = $this->actingAs($user)->post('api/chat/messages', [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +test('delete bot echo returns an ok response', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $user = \App\Models\User::factory()->create(); + $userEchos = \App\Models\UserEcho::factory()->times(3)->create(); + $authUser = \App\Models\User::factory()->create(); + + $response = $this->actingAs($authUser)->post('api/chat/echoes/{user_id}/delete/bot', [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +test('delete message returns an ok response', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->post('api/chat/message/{id}/delete', [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +test('delete room echo returns an ok response', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $user = \App\Models\User::factory()->create(); + $userEchos = \App\Models\UserEcho::factory()->times(3)->create(); + $authUser = \App\Models\User::factory()->create(); + + $response = $this->actingAs($authUser)->post('api/chat/echoes/{user_id}/delete/chatroom', [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +test('delete target echo returns an ok response', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $user = \App\Models\User::factory()->create(); + $userEchos = \App\Models\UserEcho::factory()->times(3)->create(); + $authUser = \App\Models\User::factory()->create(); + + $response = $this->actingAs($authUser)->post('api/chat/echoes/{user_id}/delete/target', [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +test('echoes returns an ok response', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $user = \App\Models\User::factory()->create(); + $authUser = \App\Models\User::factory()->create(); + + $response = $this->actingAs($authUser)->get('api/chat/echoes'); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +test('messages returns an ok response', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->get('api/chat/messages/{room_id}'); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +test('private messages returns an ok response', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->get('api/chat/private/messages/{target_id}'); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +test('rooms returns an ok response', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->get('api/chat/rooms'); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +test('statuses returns an ok response', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->get('api/chat/statuses'); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +test('toggle bot audible returns an ok response', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $user = \App\Models\User::factory()->create(); + $userAudibles = \App\Models\UserAudible::factory()->times(3)->create(); + $authUser = \App\Models\User::factory()->create(); + + $response = $this->actingAs($authUser)->post('api/chat/audibles/{user_id}/toggle/bot', [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +test('toggle room audible returns an ok response', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $user = \App\Models\User::factory()->create(); + $userAudibles = \App\Models\UserAudible::factory()->times(3)->create(); + $authUser = \App\Models\User::factory()->create(); + + $response = $this->actingAs($authUser)->post('api/chat/audibles/{user_id}/toggle/chatroom', [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +test('toggle target audible returns an ok response', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $user = \App\Models\User::factory()->create(); + $userAudibles = \App\Models\UserAudible::factory()->times(3)->create(); + $authUser = \App\Models\User::factory()->create(); + + $response = $this->actingAs($authUser)->post('api/chat/audibles/{user_id}/toggle/target', [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +test('update user chat status returns an ok response', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $user = \App\Models\User::factory()->create(); + $authUser = \App\Models\User::factory()->create(); + + $response = $this->actingAs($authUser)->post('api/chat/user/{id}/status', [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +test('update user room returns an ok response', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $user = \App\Models\User::factory()->create(); + $userEchos = \App\Models\UserEcho::factory()->times(3)->create(); + $authUser = \App\Models\User::factory()->create(); + + $response = $this->actingAs($authUser)->post('api/chat/user/{id}/chatroom', [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +test('update user target returns an ok response', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $user = \App\Models\User::factory()->create(); + $authUser = \App\Models\User::factory()->create(); + + $response = $this->actingAs($authUser)->post('api/chat/user/{id}/target', [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +// test cases... diff --git a/tests/Feature/Http/Controllers/API/TorrentControllerTest.shift.php b/tests/Feature/Http/Controllers/API/TorrentControllerTest.shift.php new file mode 100644 index 000000000..59c4ba0b6 --- /dev/null +++ b/tests/Feature/Http/Controllers/API/TorrentControllerTest.shift.php @@ -0,0 +1,66 @@ +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... diff --git a/tests/Feature/Http/Controllers/AnnounceControllerTest.shift.php b/tests/Feature/Http/Controllers/AnnounceControllerTest.shift.php new file mode 100644 index 000000000..267c287c9 --- /dev/null +++ b/tests/Feature/Http/Controllers/AnnounceControllerTest.shift.php @@ -0,0 +1,13 @@ +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... diff --git a/tests/Feature/Http/Controllers/ApprovedRequestFillControllerTest.php b/tests/Feature/Http/Controllers/ApprovedRequestFillControllerTest.php new file mode 100644 index 000000000..6ef863368 --- /dev/null +++ b/tests/Feature/Http/Controllers/ApprovedRequestFillControllerTest.php @@ -0,0 +1,62 @@ +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(); + + $response = $this->actingAs($user)->delete(route('requests.approved_fills.destroy', [$torrentRequest])); + + $response->assertOk(); + $this->assertModelMissing($torrentRequest); + + // TODO: perform additional assertions +}); + +test('destroy aborts with a 403', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $torrentRequest = \App\Models\TorrentRequest::factory()->create(); + $user = \App\Models\User::factory()->create(); + + // TODO: perform additional setup to trigger `abort_unless(403)`... + + $response = $this->actingAs($user)->delete(route('requests.approved_fills.destroy', [$torrentRequest])); + + $response->assertForbidden(); +}); + +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(); + + $response = $this->actingAs($user)->post(route('requests.approved_fills.store', [$torrentRequest]), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +test('store aborts with a 403', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $torrentRequest = \App\Models\TorrentRequest::factory()->create(); + $user = \App\Models\User::factory()->create(); + + // TODO: perform additional setup to trigger `abort_unless(403)`... + + $response = $this->actingAs($user)->post(route('requests.approved_fills.store', [$torrentRequest]), [ + // TODO: send request data + ]); + + $response->assertForbidden(); +}); + +// test cases... diff --git a/tests/Feature/Http/Controllers/ArticleControllerTest.shift.php b/tests/Feature/Http/Controllers/ArticleControllerTest.shift.php new file mode 100644 index 000000000..16cdca6c0 --- /dev/null +++ b/tests/Feature/Http/Controllers/ArticleControllerTest.shift.php @@ -0,0 +1,35 @@ +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... diff --git a/tests/Feature/Http/Controllers/Auth/ActivationControllerTest.shift.php b/tests/Feature/Http/Controllers/Auth/ActivationControllerTest.shift.php new file mode 100644 index 000000000..af8ec089e --- /dev/null +++ b/tests/Feature/Http/Controllers/Auth/ActivationControllerTest.shift.php @@ -0,0 +1,13 @@ +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... diff --git a/tests/Feature/Http/Controllers/Auth/ApplicationControllerTest.shift.php b/tests/Feature/Http/Controllers/Auth/ApplicationControllerTest.shift.php new file mode 100644 index 000000000..90bc46a24 --- /dev/null +++ b/tests/Feature/Http/Controllers/Auth/ApplicationControllerTest.shift.php @@ -0,0 +1,26 @@ +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... diff --git a/tests/Feature/Http/Controllers/Auth/ForgotUsernameControllerTest.shift.php b/tests/Feature/Http/Controllers/Auth/ForgotUsernameControllerTest.shift.php new file mode 100644 index 000000000..207c9ac1c --- /dev/null +++ b/tests/Feature/Http/Controllers/Auth/ForgotUsernameControllerTest.shift.php @@ -0,0 +1,30 @@ +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... diff --git a/tests/Feature/Http/Controllers/Auth/TwoStepControllerTest.shift.php b/tests/Feature/Http/Controllers/Auth/TwoStepControllerTest.shift.php new file mode 100644 index 000000000..2f1589e4e --- /dev/null +++ b/tests/Feature/Http/Controllers/Auth/TwoStepControllerTest.shift.php @@ -0,0 +1,100 @@ +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... diff --git a/tests/Feature/Http/Controllers/BountyControllerTest.php b/tests/Feature/Http/Controllers/BountyControllerTest.php new file mode 100644 index 000000000..759e68915 --- /dev/null +++ b/tests/Feature/Http/Controllers/BountyControllerTest.php @@ -0,0 +1,43 @@ +assertActionUsesFormRequest( + \App\Http\Controllers\BountyController::class, + 'store', + \App\Http\Requests\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(); + + $response = $this->actingAs($user)->post(route('requests.bounties.store', [$torrentRequest]), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +test('store aborts with a 403', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $torrentRequest = \App\Models\TorrentRequest::factory()->create(); + $user = \App\Models\User::factory()->create(); + + // TODO: perform additional setup to trigger `abort_unless(403)`... + + $response = $this->actingAs($user)->post(route('requests.bounties.store', [$torrentRequest]), [ + // TODO: send request data + ]); + + $response->assertForbidden(); +}); + +// test cases... diff --git a/tests/Feature/Http/Controllers/ClaimControllerTest.php b/tests/Feature/Http/Controllers/ClaimControllerTest.php new file mode 100644 index 000000000..0bcac635a --- /dev/null +++ b/tests/Feature/Http/Controllers/ClaimControllerTest.php @@ -0,0 +1,57 @@ +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(); + + $response = $this->actingAs($user)->delete(route('requests.claims.destroy', [$torrentRequest, 'claim' => $claim])); + + $response->assertOk(); + $this->assertModelMissing($claim); + + // TODO: perform additional assertions +}); + +test('destroy aborts with a 403', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $torrentRequest = \App\Models\TorrentRequest::factory()->create(); + $torrentRequestClaim = \App\Models\TorrentRequestClaim::factory()->create(); + $user = \App\Models\User::factory()->create(); + + // TODO: perform additional setup to trigger `abort_unless(403)`... + + $response = $this->actingAs($user)->delete(route('requests.claims.destroy', [$torrentRequest, 'claim' => $claim])); + + $response->assertForbidden(); +}); + +test('store validates with a form request', function (): void { + $this->assertActionUsesFormRequest( + \App\Http\Controllers\ClaimController::class, + 'store', + \App\Http\Requests\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(); + + $response = $this->actingAs($user)->post(route('requests.claims.store', [$torrentRequest]), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +// test cases... diff --git a/tests/Feature/Http/Controllers/ContactControllerTest.shift.php b/tests/Feature/Http/Controllers/ContactControllerTest.shift.php new file mode 100644 index 000000000..1dd1559fe --- /dev/null +++ b/tests/Feature/Http/Controllers/ContactControllerTest.shift.php @@ -0,0 +1,33 @@ +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... diff --git a/tests/Feature/Http/Controllers/ForumCategoryControllerTest.php b/tests/Feature/Http/Controllers/ForumCategoryControllerTest.php new file mode 100644 index 000000000..25c995288 --- /dev/null +++ b/tests/Feature/Http/Controllers/ForumCategoryControllerTest.php @@ -0,0 +1,20 @@ +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.categories.show', ['id' => $id])); + + $response->assertOk(); + $response->assertViewIs('forum.category_topic.index'); + $response->assertViewHas('forum', $forum); + + // TODO: perform additional assertions +}); + +// test cases... diff --git a/tests/Feature/Http/Controllers/ForumControllerTest.shift.php b/tests/Feature/Http/Controllers/ForumControllerTest.shift.php new file mode 100644 index 000000000..47374dbbd --- /dev/null +++ b/tests/Feature/Http/Controllers/ForumControllerTest.shift.php @@ -0,0 +1,38 @@ +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... diff --git a/tests/Feature/Http/Controllers/HomeControllerTest.shift.php b/tests/Feature/Http/Controllers/HomeControllerTest.shift.php new file mode 100644 index 000000000..f328a1a24 --- /dev/null +++ b/tests/Feature/Http/Controllers/HomeControllerTest.shift.php @@ -0,0 +1,48 @@ +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... diff --git a/tests/Feature/Http/Controllers/MediaHub/CollectionControllerTest.php b/tests/Feature/Http/Controllers/MediaHub/CollectionControllerTest.php new file mode 100644 index 000000000..7d0f931ef --- /dev/null +++ b/tests/Feature/Http/Controllers/MediaHub/CollectionControllerTest.php @@ -0,0 +1,33 @@ +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('mediahub.collections.index')); + + $response->assertOk(); + $response->assertViewIs('mediahub.collection.index'); + + // 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.'); + + $collection = \App\Models\Collection::factory()->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->get(route('mediahub.collections.show', ['id' => $collection->id])); + + $response->assertOk(); + $response->assertViewIs('mediahub.collection.show'); + $response->assertViewHas('collection', $collection); + + // TODO: perform additional assertions +}); + +// test cases... diff --git a/tests/Feature/Http/Controllers/MediaHub/CompanyControllerTest.php b/tests/Feature/Http/Controllers/MediaHub/CompanyControllerTest.php new file mode 100644 index 000000000..3ef68b541 --- /dev/null +++ b/tests/Feature/Http/Controllers/MediaHub/CompanyControllerTest.php @@ -0,0 +1,18 @@ +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('mediahub.companies.index')); + + $response->assertOk(); + $response->assertViewIs('mediahub.company.index'); + + // TODO: perform additional assertions +}); + +// test cases... diff --git a/tests/Feature/Http/Controllers/MediaHub/GenreControllerTest.php b/tests/Feature/Http/Controllers/MediaHub/GenreControllerTest.php new file mode 100644 index 000000000..03d413bb3 --- /dev/null +++ b/tests/Feature/Http/Controllers/MediaHub/GenreControllerTest.php @@ -0,0 +1,20 @@ +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(); + + $response = $this->actingAs($user)->get(route('mediahub.genres.index')); + + $response->assertOk(); + $response->assertViewIs('mediahub.genre.index'); + $response->assertViewHas('genres', $genres); + + // TODO: perform additional assertions +}); + +// test cases... diff --git a/tests/Feature/Http/Controllers/MediaHub/HomeControllerTest.php b/tests/Feature/Http/Controllers/MediaHub/HomeControllerTest.php new file mode 100644 index 000000000..f8935b518 --- /dev/null +++ b/tests/Feature/Http/Controllers/MediaHub/HomeControllerTest.php @@ -0,0 +1,26 @@ +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('mediahub.index')); + + $response->assertOk(); + $response->assertViewIs('mediahub.index'); + $response->assertViewHas('tv'); + $response->assertViewHas('movies'); + $response->assertViewHas('movieCategoryIds'); + $response->assertViewHas('collections'); + $response->assertViewHas('persons'); + $response->assertViewHas('genres'); + $response->assertViewHas('networks'); + $response->assertViewHas('companies'); + + // TODO: perform additional assertions +}); + +// test cases... diff --git a/tests/Feature/Http/Controllers/MediaHub/NetworkControllerTest.php b/tests/Feature/Http/Controllers/MediaHub/NetworkControllerTest.php new file mode 100644 index 000000000..4ecd167ea --- /dev/null +++ b/tests/Feature/Http/Controllers/MediaHub/NetworkControllerTest.php @@ -0,0 +1,18 @@ +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('mediahub.networks.index')); + + $response->assertOk(); + $response->assertViewIs('mediahub.network.index'); + + // TODO: perform additional assertions +}); + +// test cases... diff --git a/tests/Feature/Http/Controllers/MediaHub/PersonControllerTest.php b/tests/Feature/Http/Controllers/MediaHub/PersonControllerTest.php new file mode 100644 index 000000000..03d9d7c42 --- /dev/null +++ b/tests/Feature/Http/Controllers/MediaHub/PersonControllerTest.php @@ -0,0 +1,35 @@ +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('mediahub.persons.index')); + + $response->assertOk(); + $response->assertViewIs('mediahub.person.index'); + + // 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.'); + + $person = \App\Models\Person::factory()->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->get(route('mediahub.persons.show', ['id' => $person->id])); + + $response->assertOk(); + $response->assertViewIs('mediahub.person.show'); + $response->assertViewHas('person', $person); + $response->assertViewHas('movieCategoryIds'); + $response->assertViewHas('tvCategoryIds'); + + // TODO: perform additional assertions +}); + +// test cases... diff --git a/tests/Feature/Http/Controllers/MediaHub/TvSeasonControllerTest.php b/tests/Feature/Http/Controllers/MediaHub/TvSeasonControllerTest.php new file mode 100644 index 000000000..e36f575a6 --- /dev/null +++ b/tests/Feature/Http/Controllers/MediaHub/TvSeasonControllerTest.php @@ -0,0 +1,22 @@ +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(); + + $response = $this->actingAs($user)->get(route('mediahub.season.show', ['id' => $id])); + + $response->assertOk(); + $response->assertViewIs('mediahub.tv.season.show'); + $response->assertViewHas('season', $season); + $response->assertViewHas('show'); + + // TODO: perform additional assertions +}); + +// test cases... diff --git a/tests/Feature/Http/Controllers/MediaHub/TvShowControllerTest.php b/tests/Feature/Http/Controllers/MediaHub/TvShowControllerTest.php new file mode 100644 index 000000000..bfcc388ef --- /dev/null +++ b/tests/Feature/Http/Controllers/MediaHub/TvShowControllerTest.php @@ -0,0 +1,33 @@ +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('mediahub.shows.index')); + + $response->assertOk(); + $response->assertViewIs('mediahub.tv.index'); + + // 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.'); + + $tv = \App\Models\Tv::factory()->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->get(route('mediahub.shows.show', ['id' => $id])); + + $response->assertOk(); + $response->assertViewIs('mediahub.tv.show'); + $response->assertViewHas('show'); + + // TODO: perform additional assertions +}); + +// test cases... diff --git a/tests/Feature/Http/Controllers/MissingControllerTest.php b/tests/Feature/Http/Controllers/MissingControllerTest.php new file mode 100644 index 000000000..8ffaf5ff6 --- /dev/null +++ b/tests/Feature/Http/Controllers/MissingControllerTest.php @@ -0,0 +1,18 @@ +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('missing.index')); + + $response->assertOk(); + $response->assertViewIs('missing.index'); + + // TODO: perform additional assertions +}); + +// test cases... diff --git a/tests/Feature/Http/Controllers/PageControllerTest.php b/tests/Feature/Http/Controllers/PageControllerTest.php new file mode 100644 index 000000000..6e281499b --- /dev/null +++ b/tests/Feature/Http/Controllers/PageControllerTest.php @@ -0,0 +1,93 @@ +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('about')); + + $response->assertOk(); + $response->assertViewIs('page.aboutus'); + + // TODO: perform additional assertions +}); + +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(); + + $response = $this->actingAs($user)->get(route('client_blacklist')); + + $response->assertOk(); + $response->assertViewIs('page.blacklist.client'); + $response->assertViewHas('clients'); + + // 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.'); + + $pages = \App\Models\Page::factory()->times(3)->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->get(route('pages.index')); + + $response->assertOk(); + $response->assertViewIs('page.index'); + $response->assertViewHas('pages', $pages); + + // TODO: perform additional assertions +}); + +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(); + + $response = $this->actingAs($user)->get(route('internal')); + + $response->assertOk(); + $response->assertViewIs('page.internal'); + $response->assertViewHas('internals', $internals); + + // 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.'); + + $page = \App\Models\Page::factory()->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->get(route('pages.show', [$page])); + + $response->assertOk(); + $response->assertViewIs('page.page'); + $response->assertViewHas('page', $page); + + // TODO: perform additional assertions +}); + +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(); + + $response = $this->actingAs($user)->get(route('staff')); + + $response->assertOk(); + $response->assertViewIs('page.staff'); + $response->assertViewHas('staff'); + + // TODO: perform additional assertions +}); + +// test cases... diff --git a/tests/Feature/Http/Controllers/PlaylistControllerTest.php b/tests/Feature/Http/Controllers/PlaylistControllerTest.php new file mode 100644 index 000000000..9c7ba36ab --- /dev/null +++ b/tests/Feature/Http/Controllers/PlaylistControllerTest.php @@ -0,0 +1,182 @@ +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('playlists.create')); + + $response->assertOk(); + $response->assertViewIs('playlist.create'); + + // TODO: perform additional assertions +}); + +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(); + + $response = $this->actingAs($user)->delete(route('playlists.destroy', [$playlist])); + + $response->assertOk(); + $this->assertModelMissing($playlist); + + // TODO: perform additional assertions +}); + +test('destroy aborts with a 403', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $playlist = \App\Models\Playlist::factory()->create(); + $user = \App\Models\User::factory()->create(); + + // TODO: perform additional setup to trigger `abort_unless(403)`... + + $response = $this->actingAs($user)->delete(route('playlists.destroy', [$playlist])); + + $response->assertForbidden(); +}); + +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(); + + $response = $this->actingAs($user)->get(route('playlists.edit', [$playlist])); + + $response->assertOk(); + $response->assertViewIs('playlist.edit'); + $response->assertViewHas('playlist', $playlist); + + // TODO: perform additional assertions +}); + +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(); + + // TODO: perform additional setup to trigger `abort_unless(403)`... + + $response = $this->actingAs($user)->get(route('playlists.edit', [$playlist])); + + $response->assertForbidden(); +}); + +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(); + + $response = $this->actingAs($user)->get(route('playlists.index')); + + $response->assertOk(); + $response->assertViewIs('playlist.index'); + $response->assertViewHas('playlists', $playlists); + + // 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.'); + + $playlist = \App\Models\Playlist::factory()->create(); + $tv = \App\Models\Tv::factory()->create(); + $movie = \App\Models\Movie::factory()->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->get(route('playlists.show', [$playlist])); + + $response->assertOk(); + $response->assertViewIs('playlist.show'); + $response->assertViewHas('playlist', $playlist); + $response->assertViewHas('meta'); + $response->assertViewHas('torrents'); + + // TODO: perform additional assertions +}); + +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(); + + // TODO: perform additional setup to trigger `abort_if(403)`... + + $response = $this->actingAs($user)->get(route('playlists.show', [$playlist])); + + $response->assertForbidden(); +}); + +test('store validates with a form request', function (): void { + $this->assertActionUsesFormRequest( + \App\Http\Controllers\PlaylistController::class, + 'store', + \App\Http\Requests\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(); + + $response = $this->actingAs($user)->post(route('playlists.store'), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +test('update validates with a form request', function (): void { + $this->assertActionUsesFormRequest( + \App\Http\Controllers\PlaylistController::class, + 'update', + \App\Http\Requests\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(); + + $response = $this->actingAs($user)->patch(route('playlists.update', [$playlist]), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // 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.'); + + $playlist = \App\Models\Playlist::factory()->create(); + $user = \App\Models\User::factory()->create(); + + // TODO: perform additional setup to trigger `abort_unless(403)`... + + $response = $this->actingAs($user)->patch(route('playlists.update', [$playlist]), [ + // TODO: send request data + ]); + + $response->assertForbidden(); +}); + +// test cases... diff --git a/tests/Feature/Http/Controllers/PlaylistTorrentControllerTest.php b/tests/Feature/Http/Controllers/PlaylistTorrentControllerTest.php new file mode 100644 index 000000000..67f54b0f8 --- /dev/null +++ b/tests/Feature/Http/Controllers/PlaylistTorrentControllerTest.php @@ -0,0 +1,108 @@ +markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $playlistTorrent = \App\Models\PlaylistTorrent::factory()->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->delete(route('playlist_torrents.destroy', [$playlistTorrent])); + + $response->assertOk(); + $this->assertModelMissing($playlistTorrent); + + // TODO: perform additional assertions +}); + +test('destroy aborts with a 403', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $playlistTorrent = \App\Models\PlaylistTorrent::factory()->create(); + $user = \App\Models\User::factory()->create(); + + // TODO: perform additional setup to trigger `abort_unless(403)`... + + $response = $this->actingAs($user)->delete(route('playlist_torrents.destroy', [$playlistTorrent])); + + $response->assertForbidden(); +}); + +test('massupsert validates with a form request', function (): void { + $this->assertActionUsesFormRequest( + \App\Http\Controllers\PlaylistTorrentController::class, + 'massUpsert', + \App\Http\Requests\MassUpsertPlaylistTorrentRequest::class + ); +}); + +test('mass upsert returns an ok response', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $playlist = \App\Models\Playlist::factory()->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->put(route('playlist_torrents.massUpsert'), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +test('mass upsert aborts with a 403', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $playlist = \App\Models\Playlist::factory()->create(); + $user = \App\Models\User::factory()->create(); + + // TODO: perform additional setup to trigger `abort_unless(403)`... + + $response = $this->actingAs($user)->put(route('playlist_torrents.massUpsert'), [ + // TODO: send request data + ]); + + $response->assertForbidden(); +}); + +test('store validates with a form request', function (): void { + $this->assertActionUsesFormRequest( + \App\Http\Controllers\PlaylistTorrentController::class, + 'store', + \App\Http\Requests\StorePlaylistTorrentRequest::class + ); +}); + +test('store returns an ok response', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $playlist = \App\Models\Playlist::factory()->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->post(route('playlist_torrents.store'), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +test('store aborts with a 403', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $playlist = \App\Models\Playlist::factory()->create(); + $user = \App\Models\User::factory()->create(); + + // TODO: perform additional setup to trigger `abort_unless(403)`... + + $response = $this->actingAs($user)->post(route('playlist_torrents.store'), [ + // TODO: send request data + ]); + + $response->assertForbidden(); +}); + +// test cases... diff --git a/tests/Feature/Http/Controllers/PlaylistZipControllerTest.php b/tests/Feature/Http/Controllers/PlaylistZipControllerTest.php new file mode 100644 index 000000000..1700b04bc --- /dev/null +++ b/tests/Feature/Http/Controllers/PlaylistZipControllerTest.php @@ -0,0 +1,18 @@ +markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $playlist = \App\Models\Playlist::factory()->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->get(route('playlist_zips.show', [$playlist])); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +// test cases... diff --git a/tests/Feature/Http/Controllers/PollControllerTest.php b/tests/Feature/Http/Controllers/PollControllerTest.php new file mode 100644 index 000000000..6b1fe0894 --- /dev/null +++ b/tests/Feature/Http/Controllers/PollControllerTest.php @@ -0,0 +1,35 @@ +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(); + + $response = $this->actingAs($user)->get(route('polls.index')); + + $response->assertOk(); + $response->assertViewIs('poll.latest'); + $response->assertViewHas('polls', $polls); + + // 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.'); + + $poll = \App\Models\Poll::factory()->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->get(route('polls.show', [$poll])); + + $response->assertOk(); + $response->assertViewIs('poll.show'); + $response->assertViewHas('poll', $poll); + + // TODO: perform additional assertions +}); + +// test cases... diff --git a/tests/Feature/Http/Controllers/PollVoteControllerTest.php b/tests/Feature/Http/Controllers/PollVoteControllerTest.php new file mode 100644 index 000000000..24f16dab7 --- /dev/null +++ b/tests/Feature/Http/Controllers/PollVoteControllerTest.php @@ -0,0 +1,44 @@ +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(); + + $response = $this->actingAs($user)->get(route('polls.votes.index', [$poll])); + + $response->assertOk(); + $response->assertViewIs('poll.result'); + $response->assertViewHas('poll', $poll); + $response->assertViewHas('total_votes'); + + // TODO: perform additional assertions +}); + +test('store validates with a form request', function (): void { + $this->assertActionUsesFormRequest( + \App\Http\Controllers\PollVoteController::class, + 'store', + \App\Http\Requests\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(); + + $response = $this->actingAs($user)->post(route('polls.votes.store', [$poll]), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +// test cases... diff --git a/tests/Feature/Http/Controllers/PostControllerTest.php b/tests/Feature/Http/Controllers/PostControllerTest.php new file mode 100644 index 000000000..6e8f29506 --- /dev/null +++ b/tests/Feature/Http/Controllers/PostControllerTest.php @@ -0,0 +1,137 @@ +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(); + + $response = $this->actingAs($user)->delete(route('posts.destroy', ['id' => $post->id])); + + $response->assertOk(); + $this->assertModelMissing($post); + + // TODO: perform additional assertions +}); + +test('destroy aborts with a 403', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $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)->delete(route('posts.destroy', ['id' => $post->id])); + + $response->assertForbidden(); +}); + +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(); + + $response = $this->actingAs($user)->get(route('posts.edit', ['id' => $post->id])); + + $response->assertOk(); + $response->assertViewIs('forum.post.edit'); + $response->assertViewHas('topic'); + $response->assertViewHas('forum'); + $response->assertViewHas('post', $post); + $response->assertViewHas('category'); + + // TODO: perform additional assertions +}); + +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(); + + // TODO: perform additional setup to trigger `abort_unless(403)`... + + $response = $this->actingAs($user)->get(route('posts.edit', ['id' => $post->id])); + + $response->assertForbidden(); +}); + +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('posts.index')); + + $response->assertOk(); + $response->assertViewIs('forum.post.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.'); + + $topic = \App\Models\Topic::factory()->create(); + $users = \App\Models\User::factory()->times(3)->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->post(route('posts.store'), [ + // TODO: send request data + ]); + + $response->assertRedirect(withSuccess(trans('forum.reply-topic-success'))); + + // TODO: perform additional assertions +}); + +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(); + + $response = $this->actingAs($user)->patch(route('posts.update', ['id' => $post->id]), [ + // TODO: send request data + ]); + + $response->assertRedirect(withSuccess(trans('forum.edit-post-success'))); + + // 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... diff --git a/tests/Feature/Http/Controllers/ReportControllerTest.php b/tests/Feature/Http/Controllers/ReportControllerTest.php new file mode 100644 index 000000000..15b95f0c8 --- /dev/null +++ b/tests/Feature/Http/Controllers/ReportControllerTest.php @@ -0,0 +1,52 @@ +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(); + + $response = $this->actingAs($user)->post(route('report_request', ['id' => $report->id]), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +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(); + + $response = $this->actingAs($user)->post(route('report_torrent', ['id' => $report->id]), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +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(); + + $response = $this->actingAs($user)->post(route('report_user', ['username' => $report->username]), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +// test cases... diff --git a/tests/Feature/Http/Controllers/RequestControllerTest.php b/tests/Feature/Http/Controllers/RequestControllerTest.php new file mode 100644 index 000000000..d93024b9a --- /dev/null +++ b/tests/Feature/Http/Controllers/RequestControllerTest.php @@ -0,0 +1,174 @@ +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(); + + $response = $this->actingAs($user)->get(route('requests.create')); + + $response->assertOk(); + $response->assertViewIs('requests.create'); + $response->assertViewHas('categories', $categories); + $response->assertViewHas('types', $types); + $response->assertViewHas('resolutions', $resolutions); + $response->assertViewHas('user', $user); + $response->assertViewHas('category_id'); + $response->assertViewHas('title'); + $response->assertViewHas('imdb'); + $response->assertViewHas('tmdb'); + $response->assertViewHas('mal'); + $response->assertViewHas('tvdb'); + $response->assertViewHas('igdb'); + + // TODO: perform additional assertions +}); + +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(); + + $response = $this->actingAs($user)->delete(route('requests.destroy', [$torrentRequest])); + + $response->assertOk(); + $this->assertModelMissing($torrentRequest); + + // TODO: perform additional assertions +}); + +test('destroy aborts with a 403', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $torrentRequest = \App\Models\TorrentRequest::factory()->create(); + $user = \App\Models\User::factory()->create(); + + // TODO: perform additional setup to trigger `abort_unless(403)`... + + $response = $this->actingAs($user)->delete(route('requests.destroy', [$torrentRequest])); + + $response->assertForbidden(); +}); + +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(); + + $response = $this->actingAs($user)->get(route('requests.edit', [$torrentRequest])); + + $response->assertOk(); + $response->assertViewIs('requests.edit'); + $response->assertViewHas('categories', $categories); + $response->assertViewHas('types', $types); + $response->assertViewHas('resolutions', $resolutions); + $response->assertViewHas('user', $user); + $response->assertViewHas('torrentRequest', $torrentRequest); + + // 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.'); + + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->get(route('requests.index')); + + $response->assertOk(); + $response->assertViewIs('requests.index'); + + // 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.'); + + $torrentRequest = \App\Models\TorrentRequest::factory()->create(); + $tv = \App\Models\Tv::factory()->create(); + $movie = \App\Models\Movie::factory()->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->get(route('requests.show', [$torrentRequest])); + + $response->assertOk(); + $response->assertViewIs('requests.show'); + $response->assertViewHas('torrentRequest', $torrentRequest); + $response->assertViewHas('user', $user); + $response->assertViewHas('meta'); + + // TODO: perform additional assertions +}); + +test('store validates with a form request', function (): void { + $this->assertActionUsesFormRequest( + \App\Http\Controllers\RequestController::class, + 'store', + \App\Http\Requests\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(); + + $response = $this->actingAs($user)->post(route('requests.store'), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +test('update validates with a form request', function (): void { + $this->assertActionUsesFormRequest( + \App\Http\Controllers\RequestController::class, + 'update', + \App\Http\Requests\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(); + + $response = $this->actingAs($user)->patch(route('requests.update', [$torrentRequest]), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // 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.'); + + $torrentRequest = \App\Models\TorrentRequest::factory()->create(); + $user = \App\Models\User::factory()->create(); + + // TODO: perform additional setup to trigger `abort_unless(403)`... + + $response = $this->actingAs($user)->patch(route('requests.update', [$torrentRequest]), [ + // TODO: send request data + ]); + + $response->assertForbidden(); +}); + +// test cases... diff --git a/tests/Feature/Http/Controllers/RequestFillControllerTest.php b/tests/Feature/Http/Controllers/RequestFillControllerTest.php new file mode 100644 index 000000000..8cbf512e9 --- /dev/null +++ b/tests/Feature/Http/Controllers/RequestFillControllerTest.php @@ -0,0 +1,56 @@ +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(); + + $response = $this->actingAs($user)->delete(route('requests.fills.destroy', [$torrentRequest])); + + $response->assertOk(); + $this->assertModelMissing($torrentRequest); + + // TODO: perform additional assertions +}); + +test('destroy aborts with a 403', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $torrentRequest = \App\Models\TorrentRequest::factory()->create(); + $user = \App\Models\User::factory()->create(); + + // TODO: perform additional setup to trigger `abort_unless(403)`... + + $response = $this->actingAs($user)->delete(route('requests.fills.destroy', [$torrentRequest])); + + $response->assertForbidden(); +}); + +test('store validates with a form request', function (): void { + $this->assertActionUsesFormRequest( + \App\Http\Controllers\RequestFillController::class, + 'store', + \App\Http\Requests\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(); + + $response = $this->actingAs($user)->post(route('requests.fills.store', [$torrentRequest]), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +// test cases... diff --git a/tests/Feature/Http/Controllers/ReseedControllerTest.php b/tests/Feature/Http/Controllers/ReseedControllerTest.php new file mode 100644 index 000000000..be1a87a59 --- /dev/null +++ b/tests/Feature/Http/Controllers/ReseedControllerTest.php @@ -0,0 +1,22 @@ +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(); + + $response = $this->actingAs($authUser)->post(route('reseed', ['id' => $id]), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +// test cases... diff --git a/tests/Feature/Http/Controllers/RssControllerTest.php b/tests/Feature/Http/Controllers/RssControllerTest.php new file mode 100644 index 000000000..44cd1fe31 --- /dev/null +++ b/tests/Feature/Http/Controllers/RssControllerTest.php @@ -0,0 +1,155 @@ +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(); + + $response = $this->actingAs($user)->get(route('rss.create')); + + $response->assertOk(); + $response->assertViewIs('rss.create'); + $response->assertViewHas('categories', $categories); + $response->assertViewHas('types', $types); + $response->assertViewHas('resolutions', $resolutions); + $response->assertViewHas('genres', $genres); + $response->assertViewHas('user', $user); + + // TODO: perform additional assertions +}); + +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(); + + $response = $this->actingAs($user)->delete(route('rss.destroy', ['id' => $rss->id])); + + $response->assertOk(); + $this->assertModelMissing($rss); + + // TODO: perform additional assertions +}); + +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(); + + $response = $this->actingAs($user)->get(route('rss.edit', ['id' => $rss->id])); + + $response->assertOk(); + $response->assertViewIs('rss.edit'); + $response->assertViewHas('categories', $categories); + $response->assertViewHas('types', $types); + $response->assertViewHas('resolutions', $resolutions); + $response->assertViewHas('genres', $genres); + $response->assertViewHas('user', $user); + $response->assertViewHas('rss', $rss); + + // TODO: perform additional assertions +}); + +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(); + + // TODO: perform additional setup to trigger `abort_unless(403)`... + + $response = $this->actingAs($user)->get(route('rss.edit', ['id' => $rss->id])); + + $response->assertForbidden(); +}); + +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(); + + $response = $this->actingAs($user)->get(route('rss.index')); + + $response->assertOk(); + $response->assertViewIs('rss.index'); + $response->assertViewHas('hash'); + $response->assertViewHas('public_rss'); + $response->assertViewHas('private_rss'); + $response->assertViewHas('user', $user); + + // 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.'); + + $rss = \App\Models\Rss::factory()->create(); + $torrents = \App\Models\Torrent::factory()->times(3)->create(); + + $response = $this->get(route('rss.show.rsskey', ['id' => $rss->id, 'rsskey' => $rss->rsskey])); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +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(); + + // TODO: perform additional setup to trigger `abort_if(404)`... + + $response = $this->get(route('rss.show.rsskey', ['id' => $rss->id, 'rsskey' => $rss->rsskey])); + + $response->assertNotFound(); +}); + +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(); + + $response = $this->actingAs($user)->post(route('rss.store'), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +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(); + + $response = $this->actingAs($user)->patch(route('rss.update', ['id' => $rss->id]), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +// test cases... diff --git a/tests/Feature/Http/Controllers/SimilarTorrentControllerTest.php b/tests/Feature/Http/Controllers/SimilarTorrentControllerTest.php new file mode 100644 index 000000000..61f00e96e --- /dev/null +++ b/tests/Feature/Http/Controllers/SimilarTorrentControllerTest.php @@ -0,0 +1,88 @@ +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(); + + $response = $this->actingAs($user)->get(route('torrents.similar', ['category_id' => $category_id, 'tmdb' => $tmdb])); + + $response->assertOk(); + $response->assertViewIs('torrent.similar'); + $response->assertViewHas('meta'); + $response->assertViewHas('personal_freeleech'); + $response->assertViewHas('trailer'); + $response->assertViewHas('platforms'); + $response->assertViewHas('category', $category); + $response->assertViewHas('tmdb'); + $response->assertViewHas('igdb'); + + // TODO: perform additional assertions +}); + +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_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->assertNotFound(); +}); + +// test cases... diff --git a/tests/Feature/Http/Controllers/Staff/ApplicationControllerTest.php b/tests/Feature/Http/Controllers/Staff/ApplicationControllerTest.php new file mode 100644 index 000000000..007f96f2b --- /dev/null +++ b/tests/Feature/Http/Controllers/Staff/ApplicationControllerTest.php @@ -0,0 +1,81 @@ +assertActionUsesFormRequest( + \App\Http\Controllers\Staff\ApplicationController::class, + 'approve', + \App\Http\Requests\Staff\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(); + + $response = $this->actingAs($user)->post(route('staff.applications.approve', ['id' => $application->id]), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // 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.'); + + $applications = \App\Models\Application::factory()->times(3)->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->get(route('staff.applications.index')); + + $response->assertOk(); + $response->assertViewIs('Staff.application.index'); + $response->assertViewHas('applications', $applications); + + // TODO: perform additional assertions +}); + +test('reject validates with a form request', function (): void { + $this->assertActionUsesFormRequest( + \App\Http\Controllers\Staff\ApplicationController::class, + 'reject', + \App\Http\Requests\Staff\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(); + + $response = $this->actingAs($user)->post(route('staff.applications.reject', ['id' => $application->id]), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // 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.'); + + $application = \App\Models\Application::factory()->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->get(route('staff.applications.show', ['id' => $application->id])); + + $response->assertOk(); + $response->assertViewIs('Staff.application.show'); + $response->assertViewHas('application', $application); + + // TODO: perform additional assertions +}); + +// test cases... diff --git a/tests/Feature/Http/Controllers/Staff/ArticleControllerTest.shift.php b/tests/Feature/Http/Controllers/Staff/ArticleControllerTest.shift.php new file mode 100644 index 000000000..d0639b50a --- /dev/null +++ b/tests/Feature/Http/Controllers/Staff/ArticleControllerTest.shift.php @@ -0,0 +1,107 @@ +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('staff.articles.create')); + + $response->assertOk(); + $response->assertViewIs('Staff.article.create'); + + // TODO: perform additional assertions +}); + +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(); + + $response = $this->actingAs($user)->delete(route('staff.articles.destroy', [$article])); + + $response->assertOk(); + $this->assertModelMissing($article); + + // TODO: perform additional assertions +}); + +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(); + + $response = $this->actingAs($user)->get(route('staff.articles.edit', [$article])); + + $response->assertOk(); + $response->assertViewIs('Staff.article.edit'); + $response->assertViewHas('article', $article); + + // 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.'); + + $articles = \App\Models\Article::factory()->times(3)->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->get(route('staff.articles.index')); + + $response->assertOk(); + $response->assertViewIs('Staff.article.index'); + $response->assertViewHas('articles', $articles); + + // TODO: perform additional assertions +}); + +test('store validates with a form request', function (): void { + $this->assertActionUsesFormRequest( + \App\Http\Controllers\Staff\ArticleController::class, + 'store', + \App\Http\Requests\Staff\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(); + + $response = $this->actingAs($user)->post(route('staff.articles.store'), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +test('update validates with a form request', function (): void { + $this->assertActionUsesFormRequest( + \App\Http\Controllers\Staff\ArticleController::class, + 'update', + \App\Http\Requests\Staff\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(); + + $response = $this->actingAs($user)->post(route('staff.articles.update', [$article]), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +// test cases... diff --git a/tests/Feature/Http/Controllers/Staff/AuditControllerTest.php b/tests/Feature/Http/Controllers/Staff/AuditControllerTest.php new file mode 100644 index 000000000..61487bfae --- /dev/null +++ b/tests/Feature/Http/Controllers/Staff/AuditControllerTest.php @@ -0,0 +1,32 @@ +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(); + + $response = $this->actingAs($user)->delete(route('staff.audits.destroy', [$audit])); + + $response->assertOk(); + $this->assertModelMissing($audit); + + // 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.'); + + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->get(route('staff.audits.index')); + + $response->assertOk(); + $response->assertViewIs('Staff.audit.index'); + + // TODO: perform additional assertions +}); + +// test cases... diff --git a/tests/Feature/Http/Controllers/Staff/AuthenticationControllerTest.php b/tests/Feature/Http/Controllers/Staff/AuthenticationControllerTest.php new file mode 100644 index 000000000..9f690e84c --- /dev/null +++ b/tests/Feature/Http/Controllers/Staff/AuthenticationControllerTest.php @@ -0,0 +1,18 @@ +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('staff.authentications.index')); + + $response->assertOk(); + $response->assertViewIs('Staff.authentication.index'); + + // TODO: perform additional assertions +}); + +// test cases... diff --git a/tests/Feature/Http/Controllers/Staff/BackupControllerTest.php b/tests/Feature/Http/Controllers/Staff/BackupControllerTest.php new file mode 100644 index 000000000..04f72efa3 --- /dev/null +++ b/tests/Feature/Http/Controllers/Staff/BackupControllerTest.php @@ -0,0 +1,18 @@ +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('staff.backups.index')); + + $response->assertOk(); + $response->assertViewIs('Staff.backup.index'); + + // TODO: perform additional assertions +}); + +// test cases... diff --git a/tests/Feature/Http/Controllers/Staff/BanControllerTest.php b/tests/Feature/Http/Controllers/Staff/BanControllerTest.php new file mode 100644 index 000000000..8a1bbc061 --- /dev/null +++ b/tests/Feature/Http/Controllers/Staff/BanControllerTest.php @@ -0,0 +1,58 @@ +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(); + + $response = $this->actingAs($user)->get(route('staff.bans.index')); + + $response->assertOk(); + $response->assertViewIs('Staff.ban.index'); + $response->assertViewHas('bans', $bans); + + // TODO: perform additional assertions +}); + +test('store validates with a form request', function (): void { + $this->assertActionUsesFormRequest( + \App\Http\Controllers\Staff\BanController::class, + 'store', + \App\Http\Requests\Staff\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(); + + $response = $this->actingAs($authUser)->post(route('staff.bans.store'), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +test('store aborts with a 403', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $user = \App\Models\User::factory()->create(); + $authUser = \App\Models\User::factory()->create(); + + // TODO: perform additional setup to trigger `abort_if(403)`... + + $response = $this->actingAs($authUser)->post(route('staff.bans.store'), [ + // TODO: send request data + ]); + + $response->assertForbidden(); +}); + +// test cases... diff --git a/tests/Feature/Http/Controllers/Staff/BlacklistClientControllerTest.php b/tests/Feature/Http/Controllers/Staff/BlacklistClientControllerTest.php new file mode 100644 index 000000000..4565c29ff --- /dev/null +++ b/tests/Feature/Http/Controllers/Staff/BlacklistClientControllerTest.php @@ -0,0 +1,107 @@ +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('staff.blacklisted_clients.create')); + + $response->assertOk(); + $response->assertViewIs('Staff.blacklist.clients.create'); + + // TODO: perform additional assertions +}); + +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(); + + $response = $this->actingAs($user)->delete(route('staff.blacklisted_clients.destroy', [$blacklistClient])); + + $response->assertOk(); + $this->assertModelMissing($blacklistClient); + + // TODO: perform additional assertions +}); + +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(); + + $response = $this->actingAs($user)->get(route('staff.blacklisted_clients.edit', [$blacklistClient])); + + $response->assertOk(); + $response->assertViewIs('Staff.blacklist.clients.edit'); + $response->assertViewHas('client'); + + // 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.'); + + $blacklistClients = \App\Models\BlacklistClient::factory()->times(3)->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->get(route('staff.blacklisted_clients.index')); + + $response->assertOk(); + $response->assertViewIs('Staff.blacklist.clients.index'); + $response->assertViewHas('clients'); + + // TODO: perform additional assertions +}); + +test('store validates with a form request', function (): void { + $this->assertActionUsesFormRequest( + \App\Http\Controllers\Staff\BlacklistClientController::class, + 'store', + \App\Http\Requests\Staff\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(); + + $response = $this->actingAs($user)->post(route('staff.blacklisted_clients.store'), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +test('update validates with a form request', function (): void { + $this->assertActionUsesFormRequest( + \App\Http\Controllers\Staff\BlacklistClientController::class, + 'update', + \App\Http\Requests\Staff\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(); + + $response = $this->actingAs($user)->patch(route('staff.blacklisted_clients.update', [$blacklistClient]), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +// test cases... diff --git a/tests/Feature/Http/Controllers/Staff/BonExchangeControllerTest.php b/tests/Feature/Http/Controllers/Staff/BonExchangeControllerTest.php new file mode 100644 index 000000000..a966a0e4d --- /dev/null +++ b/tests/Feature/Http/Controllers/Staff/BonExchangeControllerTest.php @@ -0,0 +1,107 @@ +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('staff.bon_exchanges.create')); + + $response->assertOk(); + $response->assertViewIs('Staff.bon_exchange.create'); + + // TODO: perform additional assertions +}); + +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.'); + + $bonExchange = \App\Models\BonExchange::factory()->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->delete(route('staff.bon_exchanges.destroy', [$bonExchange])); + + $response->assertOk(); + $this->assertModelMissing($bonExchange); + + // TODO: perform additional assertions +}); + +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.'); + + $bonExchange = \App\Models\BonExchange::factory()->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->get(route('staff.bon_exchanges.edit', [$bonExchange])); + + $response->assertOk(); + $response->assertViewIs('Staff.bon_exchange.edit'); + $response->assertViewHas('bonExchange', $bonExchange); + + // 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.'); + + $bonExchanges = \App\Models\BonExchange::factory()->times(3)->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->get(route('staff.bon_exchanges.index')); + + $response->assertOk(); + $response->assertViewIs('Staff.bon_exchange.index'); + $response->assertViewHas('bonExchanges', $bonExchanges); + + // TODO: perform additional assertions +}); + +test('store validates with a form request', function (): void { + $this->assertActionUsesFormRequest( + \App\Http\Controllers\Staff\BonExchangeController::class, + 'store', + \App\Http\Requests\Staff\StoreBonExchangeRequest::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(); + + $response = $this->actingAs($user)->post(route('staff.bon_exchanges.store'), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +test('update validates with a form request', function (): void { + $this->assertActionUsesFormRequest( + \App\Http\Controllers\Staff\BonExchangeController::class, + 'update', + \App\Http\Requests\Staff\UpdateBonExchangeRequest::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.'); + + $bonExchange = \App\Models\BonExchange::factory()->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->patch(route('staff.bon_exchanges.update', [$bonExchange]), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +// test cases... diff --git a/tests/Feature/Http/Controllers/Staff/CategoryControllerTest.shift.php b/tests/Feature/Http/Controllers/Staff/CategoryControllerTest.shift.php new file mode 100644 index 000000000..0c38802df --- /dev/null +++ b/tests/Feature/Http/Controllers/Staff/CategoryControllerTest.shift.php @@ -0,0 +1,107 @@ +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('staff.categories.create')); + + $response->assertOk(); + $response->assertViewIs('Staff.category.create'); + + // TODO: perform additional assertions +}); + +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.'); + + $category = \App\Models\Category::factory()->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->delete(route('staff.categories.destroy', [$category])); + + $response->assertOk(); + $this->assertModelMissing($category); + + // TODO: perform additional assertions +}); + +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.'); + + $category = \App\Models\Category::factory()->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->get(route('staff.categories.edit', [$category])); + + $response->assertOk(); + $response->assertViewIs('Staff.category.edit'); + $response->assertViewHas('category', $category); + + // 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.'); + + $categories = \App\Models\Category::factory()->times(3)->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->get(route('staff.categories.index')); + + $response->assertOk(); + $response->assertViewIs('Staff.category.index'); + $response->assertViewHas('categories', $categories); + + // TODO: perform additional assertions +}); + +test('store validates with a form request', function (): void { + $this->assertActionUsesFormRequest( + \App\Http\Controllers\Staff\CategoryController::class, + 'store', + \App\Http\Requests\Staff\StoreCategoryRequest::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(); + + $response = $this->actingAs($user)->post(route('staff.categories.store'), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +test('update validates with a form request', function (): void { + $this->assertActionUsesFormRequest( + \App\Http\Controllers\Staff\CategoryController::class, + 'update', + \App\Http\Requests\Staff\UpdateCategoryRequest::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.'); + + $category = \App\Models\Category::factory()->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->patch(route('staff.categories.update', [$category]), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +// test cases... diff --git a/tests/Feature/Http/Controllers/Staff/ChatBotControllerTest.shift.php b/tests/Feature/Http/Controllers/Staff/ChatBotControllerTest.shift.php new file mode 100644 index 000000000..2638bf762 --- /dev/null +++ b/tests/Feature/Http/Controllers/Staff/ChatBotControllerTest.shift.php @@ -0,0 +1,116 @@ +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(); + + $response = $this->actingAs($user)->delete(route('staff.bots.destroy', [$bot])); + + $response->assertOk(); + $this->assertModelMissing($bot); + + // TODO: perform additional assertions +}); + +test('destroy aborts with a 403', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $bot = \App\Models\Bot::factory()->create(); + $user = \App\Models\User::factory()->create(); + + // TODO: perform additional setup to trigger `abort_if(403)`... + + $response = $this->actingAs($user)->delete(route('staff.bots.destroy', [$bot])); + + $response->assertForbidden(); +}); + +test('disable 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(); + + $response = $this->actingAs($user)->post(route('staff.bots.disable', [$bot]), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +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.'); + + $bot = \App\Models\Bot::factory()->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->get(route('staff.bots.edit', [$bot])); + + $response->assertOk(); + $response->assertViewIs('Staff.chat.bot.edit'); + $response->assertViewHas('user', $user); + $response->assertViewHas('bot', $bot); + + // TODO: perform additional assertions +}); + +test('enable 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(); + + $response = $this->actingAs($user)->post(route('staff.bots.enable', [$bot]), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // 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.'); + + $bots = \App\Models\Bot::factory()->times(3)->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->get(route('staff.bots.index')); + + $response->assertOk(); + $response->assertViewIs('Staff.chat.bot.index'); + $response->assertViewHas('bots', $bots); + + // TODO: perform additional assertions +}); + +test('update validates with a form request', function (): void { + $this->assertActionUsesFormRequest( + \App\Http\Controllers\Staff\ChatBotController::class, + 'update', + \App\Http\Requests\Staff\UpdateChatBotRequest::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.'); + + $bot = \App\Models\Bot::factory()->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->patch(route('staff.bots.update', [$bot]), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +// test cases... diff --git a/tests/Feature/Http/Controllers/Staff/ChatRoomControllerTest.shift.php b/tests/Feature/Http/Controllers/Staff/ChatRoomControllerTest.shift.php new file mode 100644 index 000000000..eecd3eb42 --- /dev/null +++ b/tests/Feature/Http/Controllers/Staff/ChatRoomControllerTest.shift.php @@ -0,0 +1,106 @@ +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('staff.chatrooms.create')); + + $response->assertOk(); + $response->assertViewIs('Staff.chat.room.create'); + + // TODO: perform additional assertions +}); + +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.'); + + $chatroom = \App\Models\Chatroom::factory()->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->delete(route('staff.chatrooms.destroy', [$chatroom])); + + $response->assertOk(); + $this->assertModelMissing($chatroom); + + // TODO: perform additional assertions +}); + +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.'); + + $chatroom = \App\Models\Chatroom::factory()->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->get(route('staff.chatrooms.edit', [$chatroom])); + + $response->assertOk(); + $response->assertViewIs('Staff.chat.room.edit'); + $response->assertViewHas('chatroom', $chatroom); + + // 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.'); + + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->get(route('staff.chatrooms.index')); + + $response->assertOk(); + $response->assertViewIs('Staff.chat.room.index'); + $response->assertViewHas('chatrooms'); + + // TODO: perform additional assertions +}); + +test('store validates with a form request', function (): void { + $this->assertActionUsesFormRequest( + \App\Http\Controllers\Staff\ChatRoomController::class, + 'store', + \App\Http\Requests\Staff\StoreChatRoomRequest::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(); + + $response = $this->actingAs($user)->post(route('staff.chatrooms.store'), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +test('update validates with a form request', function (): void { + $this->assertActionUsesFormRequest( + \App\Http\Controllers\Staff\ChatRoomController::class, + 'update', + \App\Http\Requests\Staff\UpdateChatRoomRequest::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.'); + + $chatroom = \App\Models\Chatroom::factory()->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->post(route('staff.chatrooms.update', [$chatroom]), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +// test cases... diff --git a/tests/Feature/Http/Controllers/Staff/ChatStatusControllerTest.shift.php b/tests/Feature/Http/Controllers/Staff/ChatStatusControllerTest.shift.php new file mode 100644 index 000000000..00adcd44c --- /dev/null +++ b/tests/Feature/Http/Controllers/Staff/ChatStatusControllerTest.shift.php @@ -0,0 +1,107 @@ +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('staff.statuses.create')); + + $response->assertOk(); + $response->assertViewIs('Staff.chat.status.create'); + + // TODO: perform additional assertions +}); + +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.'); + + $chatStatus = \App\Models\ChatStatus::factory()->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->delete(route('staff.statuses.destroy', [$chatStatus])); + + $response->assertOk(); + $this->assertModelMissing($chatStatus); + + // TODO: perform additional assertions +}); + +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.'); + + $chatStatus = \App\Models\ChatStatus::factory()->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->get(route('staff.statuses.edit', [$chatStatus])); + + $response->assertOk(); + $response->assertViewIs('Staff.chat.status.edit'); + $response->assertViewHas('chatstatus'); + + // 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.'); + + $chatStatuses = \App\Models\ChatStatus::factory()->times(3)->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->get(route('staff.statuses.index')); + + $response->assertOk(); + $response->assertViewIs('Staff.chat.status.index'); + $response->assertViewHas('chatstatuses'); + + // TODO: perform additional assertions +}); + +test('store validates with a form request', function (): void { + $this->assertActionUsesFormRequest( + \App\Http\Controllers\Staff\ChatStatusController::class, + 'store', + \App\Http\Requests\Staff\StoreChatStatusRequest::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(); + + $response = $this->actingAs($user)->post(route('staff.statuses.store'), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +test('update validates with a form request', function (): void { + $this->assertActionUsesFormRequest( + \App\Http\Controllers\Staff\ChatStatusController::class, + 'update', + \App\Http\Requests\Staff\UpdateChatStatusRequest::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.'); + + $chatStatus = \App\Models\ChatStatus::factory()->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->post(route('staff.statuses.update', [$chatStatus]), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +// test cases... diff --git a/tests/Feature/Http/Controllers/Staff/CheatedTorrentControllerTest.php b/tests/Feature/Http/Controllers/Staff/CheatedTorrentControllerTest.php new file mode 100644 index 000000000..998888746 --- /dev/null +++ b/tests/Feature/Http/Controllers/Staff/CheatedTorrentControllerTest.php @@ -0,0 +1,46 @@ +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(); + + $response = $this->actingAs($user)->delete(route('staff.cheated_torrents.destroy', ['cheatedTorrent' => $cheatedTorrent])); + + $response->assertOk(); + $this->assertModelMissing($cheatedTorrent); + + // 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(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->get(route('staff.cheated_torrents.index')); + + $response->assertOk(); + $response->assertViewIs('Staff.cheated_torrent.index'); + $response->assertViewHas('torrents', $torrents); + + // TODO: perform additional assertions +}); + +test('mass 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.'); + + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->delete(route('staff.cheated_torrents.massDestroy')); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +// test cases... diff --git a/tests/Feature/Http/Controllers/Staff/CheaterControllerTest.shift.php b/tests/Feature/Http/Controllers/Staff/CheaterControllerTest.shift.php new file mode 100644 index 000000000..f06eac9c5 --- /dev/null +++ b/tests/Feature/Http/Controllers/Staff/CheaterControllerTest.shift.php @@ -0,0 +1,20 @@ +markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $users = \App\Models\User::factory()->times(3)->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->get(route('staff.cheaters.index')); + + $response->assertOk(); + $response->assertViewIs('Staff.cheater.index'); + $response->assertViewHas('cheaters'); + + // TODO: perform additional assertions +}); + +// test cases... diff --git a/tests/Feature/Http/Controllers/Staff/CommandControllerTest.php b/tests/Feature/Http/Controllers/Staff/CommandControllerTest.php new file mode 100644 index 000000000..bc69bf6f7 --- /dev/null +++ b/tests/Feature/Http/Controllers/Staff/CommandControllerTest.php @@ -0,0 +1,144 @@ +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('staff.'), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +test('clear cache 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('staff.'), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +test('clear 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(); + + $response = $this->actingAs($user)->post(route('staff.'), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +test('clear route 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('staff.'), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +test('clear view 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('staff.'), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // 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.'); + + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->get(route('staff.commands.index')); + + $response->assertOk(); + $response->assertViewIs('Staff.command.index'); + + // TODO: perform additional assertions +}); + +test('maintance disable 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('staff.'), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +test('maintance enable 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('staff.'), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +test('set all cache 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('staff.'), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +test('test email 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('staff.'), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +// test cases... diff --git a/tests/Feature/Http/Controllers/Staff/DistributorControllerTest.php b/tests/Feature/Http/Controllers/Staff/DistributorControllerTest.php new file mode 100644 index 000000000..ce32506cf --- /dev/null +++ b/tests/Feature/Http/Controllers/Staff/DistributorControllerTest.php @@ -0,0 +1,132 @@ +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('staff.distributors.create')); + + $response->assertOk(); + $response->assertViewIs('Staff.distributor.create'); + + // TODO: perform additional assertions +}); + +test('delete 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.'); + + $distributor = \App\Models\Distributor::factory()->create(); + $distributors = \App\Models\Distributor::factory()->times(3)->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->get(route('staff.distributors.delete', [$distributor])); + + $response->assertOk(); + $response->assertViewIs('Staff.distributor.delete'); + $response->assertViewHas('distributors', $distributors); + $response->assertViewHas('distributor', $distributor); + + // TODO: perform additional assertions +}); + +test('destroy validates with a form request', function (): void { + $this->assertActionUsesFormRequest( + \App\Http\Controllers\Staff\DistributorController::class, + 'destroy', + \App\Http\Requests\Staff\DestroyDistributorRequest::class + ); +}); + +test('destroy returns an ok response', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $distributor = \App\Models\Distributor::factory()->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->delete(route('staff.distributors.destroy', [$distributor])); + + $response->assertOk(); + $this->assertModelMissing($distributor); + + // TODO: perform additional assertions +}); + +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.'); + + $distributor = \App\Models\Distributor::factory()->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->get(route('staff.distributors.edit', [$distributor])); + + $response->assertOk(); + $response->assertViewIs('Staff.distributor.edit'); + $response->assertViewHas('distributor', $distributor); + + // 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.'); + + $distributors = \App\Models\Distributor::factory()->times(3)->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->get(route('staff.distributors.index')); + + $response->assertOk(); + $response->assertViewIs('Staff.distributor.index'); + $response->assertViewHas('distributors', $distributors); + + // TODO: perform additional assertions +}); + +test('store validates with a form request', function (): void { + $this->assertActionUsesFormRequest( + \App\Http\Controllers\Staff\DistributorController::class, + 'store', + \App\Http\Requests\Staff\StoreDistributorRequest::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(); + + $response = $this->actingAs($user)->post(route('staff.distributors.store'), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +test('update validates with a form request', function (): void { + $this->assertActionUsesFormRequest( + \App\Http\Controllers\Staff\DistributorController::class, + 'update', + \App\Http\Requests\Staff\UpdateDistributorRequest::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.'); + + $distributor = \App\Models\Distributor::factory()->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->patch(route('staff.distributors.update', [$distributor]), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +// test cases... diff --git a/tests/Feature/Http/Controllers/Staff/FlushControllerTest.php b/tests/Feature/Http/Controllers/Staff/FlushControllerTest.php new file mode 100644 index 000000000..6c963d7f1 --- /dev/null +++ b/tests/Feature/Http/Controllers/Staff/FlushControllerTest.php @@ -0,0 +1,36 @@ +markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $messages = \App\Models\Message::factory()->times(3)->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->post(route('staff.flush.chat'), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +test('peers 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.'); + + $history = \App\Models\History::factory()->create(); + $peers = \App\Models\Peer::factory()->times(3)->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->post(route('staff.flush.peers'), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +// test cases... diff --git a/tests/Feature/Http/Controllers/Staff/ForumControllerTest.php b/tests/Feature/Http/Controllers/Staff/ForumControllerTest.php new file mode 100644 index 000000000..6bfe18507 --- /dev/null +++ b/tests/Feature/Http/Controllers/Staff/ForumControllerTest.php @@ -0,0 +1,118 @@ +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(); + $groups = \App\Models\Group::factory()->times(3)->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->get(route('staff.forums.create')); + + $response->assertOk(); + $response->assertViewIs('Staff.forum.create'); + $response->assertViewHas('categories'); + $response->assertViewHas('groups', $groups); + + // TODO: perform additional assertions +}); + +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.'); + + $forum = \App\Models\Forum::factory()->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->delete(route('staff.forums.destroy', [$forum])); + + $response->assertOk(); + $this->assertModelMissing($forum); + + // TODO: perform additional assertions +}); + +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.'); + + $forum = \App\Models\Forum::factory()->create(); + $forums = \App\Models\Forum::factory()->times(3)->create(); + $groups = \App\Models\Group::factory()->times(3)->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->get(route('staff.forums.edit', [$forum])); + + $response->assertOk(); + $response->assertViewIs('Staff.forum.edit'); + $response->assertViewHas('categories'); + $response->assertViewHas('groups', $groups); + $response->assertViewHas('forum', $forum); + + // 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.'); + + $forums = \App\Models\Forum::factory()->times(3)->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->get(route('staff.forums.index')); + + $response->assertOk(); + $response->assertViewIs('Staff.forum.index'); + $response->assertViewHas('categories'); + + // TODO: perform additional assertions +}); + +test('store validates with a form request', function (): void { + $this->assertActionUsesFormRequest( + \App\Http\Controllers\Staff\ForumController::class, + 'store', + \App\Http\Requests\Staff\StoreForumRequest::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.'); + + $permission = \App\Models\Permission::factory()->create(); + $groups = \App\Models\Group::factory()->times(3)->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->post(route('staff.forums.store'), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +test('update validates with a form request', function (): void { + $this->assertActionUsesFormRequest( + \App\Http\Controllers\Staff\ForumController::class, + 'update', + \App\Http\Requests\Staff\UpdateForumRequest::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.'); + + $forum = \App\Models\Forum::factory()->create(); + $groups = \App\Models\Group::factory()->times(3)->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->patch(route('staff.forums.update', [$forum]), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +// test cases... diff --git a/tests/Feature/Http/Controllers/Staff/GroupControllerTest.shift.php b/tests/Feature/Http/Controllers/Staff/GroupControllerTest.shift.php new file mode 100644 index 000000000..6661de070 --- /dev/null +++ b/tests/Feature/Http/Controllers/Staff/GroupControllerTest.shift.php @@ -0,0 +1,94 @@ +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('staff.groups.create')); + + $response->assertOk(); + $response->assertViewIs('Staff.group.create'); + + // TODO: perform additional assertions +}); + +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.'); + + $group = \App\Models\Group::factory()->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->get(route('staff.groups.edit', [$group])); + + $response->assertOk(); + $response->assertViewIs('Staff.group.edit'); + $response->assertViewHas('group', $group); + + // 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.'); + + $groups = \App\Models\Group::factory()->times(3)->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->get(route('staff.groups.index')); + + $response->assertOk(); + $response->assertViewIs('Staff.group.index'); + $response->assertViewHas('groups', $groups); + + // TODO: perform additional assertions +}); + +test('store validates with a form request', function (): void { + $this->assertActionUsesFormRequest( + \App\Http\Controllers\Staff\GroupController::class, + 'store', + \App\Http\Requests\Staff\StoreGroupRequest::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(); + + $response = $this->actingAs($user)->post(route('staff.groups.store'), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +test('update validates with a form request', function (): void { + $this->assertActionUsesFormRequest( + \App\Http\Controllers\Staff\GroupController::class, + 'update', + \App\Http\Requests\Staff\UpdateGroupRequest::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.'); + + $group = \App\Models\Group::factory()->create(); + $users = \App\Models\User::factory()->times(3)->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->patch(route('staff.groups.update', [$group]), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +// test cases... diff --git a/tests/Feature/Http/Controllers/Staff/HomeControllerTest.php b/tests/Feature/Http/Controllers/Staff/HomeControllerTest.php new file mode 100644 index 000000000..5afb732b8 --- /dev/null +++ b/tests/Feature/Http/Controllers/Staff/HomeControllerTest.php @@ -0,0 +1,30 @@ +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('staff.dashboard.index')); + + $response->assertOk(); + $response->assertViewIs('Staff.dashboard.index'); + $response->assertViewHas('users'); + $response->assertViewHas('torrents'); + $response->assertViewHas('peers'); + $response->assertViewHas('reports'); + $response->assertViewHas('apps'); + $response->assertViewHas('certificate'); + $response->assertViewHas('uptime'); + $response->assertViewHas('ram'); + $response->assertViewHas('disk'); + $response->assertViewHas('avg'); + $response->assertViewHas('basic'); + $response->assertViewHas('file_permissions'); + + // TODO: perform additional assertions +}); + +// test cases... diff --git a/tests/Feature/Http/Controllers/Staff/InternalControllerTest.php b/tests/Feature/Http/Controllers/Staff/InternalControllerTest.php new file mode 100644 index 000000000..905c45ef4 --- /dev/null +++ b/tests/Feature/Http/Controllers/Staff/InternalControllerTest.php @@ -0,0 +1,107 @@ +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('staff.internals.create')); + + $response->assertOk(); + $response->assertViewIs('Staff.internals.create'); + + // TODO: perform additional assertions +}); + +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.'); + + $internal = \App\Models\Internal::factory()->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->delete(route('staff.internals.destroy', [$internal])); + + $response->assertOk(); + $this->assertModelMissing($internal); + + // TODO: perform additional assertions +}); + +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.'); + + $internal = \App\Models\Internal::factory()->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->get(route('staff.internals.edit', [$internal])); + + $response->assertOk(); + $response->assertViewIs('Staff.internals.edit'); + $response->assertViewHas('internal', $internal); + + // 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.'); + + $internals = \App\Models\Internal::factory()->times(3)->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->get(route('staff.internals.index')); + + $response->assertOk(); + $response->assertViewIs('Staff.internals.index'); + $response->assertViewHas('internals', $internals); + + // TODO: perform additional assertions +}); + +test('store validates with a form request', function (): void { + $this->assertActionUsesFormRequest( + \App\Http\Controllers\Staff\InternalController::class, + 'store', + \App\Http\Requests\Staff\StoreInternalRequest::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(); + + $response = $this->actingAs($user)->post(route('staff.internals.store'), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +test('update validates with a form request', function (): void { + $this->assertActionUsesFormRequest( + \App\Http\Controllers\Staff\InternalController::class, + 'update', + \App\Http\Requests\Staff\UpdateInternalRequest::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.'); + + $internal = \App\Models\Internal::factory()->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->patch(route('staff.internals.update', [$internal]), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +// test cases... diff --git a/tests/Feature/Http/Controllers/Staff/InviteControllerTest.shift.php b/tests/Feature/Http/Controllers/Staff/InviteControllerTest.shift.php new file mode 100644 index 000000000..a0cbd9f22 --- /dev/null +++ b/tests/Feature/Http/Controllers/Staff/InviteControllerTest.shift.php @@ -0,0 +1,18 @@ +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('staff.invites.index')); + + $response->assertOk(); + $response->assertViewIs('Staff.invite.index'); + + // TODO: perform additional assertions +}); + +// test cases... diff --git a/tests/Feature/Http/Controllers/Staff/MassActionControllerTest.shift.php b/tests/Feature/Http/Controllers/Staff/MassActionControllerTest.shift.php new file mode 100644 index 000000000..3db927443 --- /dev/null +++ b/tests/Feature/Http/Controllers/Staff/MassActionControllerTest.shift.php @@ -0,0 +1,53 @@ +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('staff.mass-pm.create')); + + $response->assertOk(); + $response->assertViewIs('Staff.masspm.index'); + + // TODO: perform additional assertions +}); + +test('store validates with a form request', function (): void { + $this->assertActionUsesFormRequest( + \App\Http\Controllers\Staff\MassActionController::class, + 'store', + \App\Http\Requests\Staff\StoreMassActionRequest::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(); + + $response = $this->actingAs($user)->post(route('staff.mass-pm.store'), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +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.'); + + $users = \App\Models\User::factory()->times(3)->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->get(route('staff.mass-actions.validate')); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +// test cases... diff --git a/tests/Feature/Http/Controllers/Staff/MediaLanguageControllerTest.php b/tests/Feature/Http/Controllers/Staff/MediaLanguageControllerTest.php new file mode 100644 index 000000000..b0b9914cb --- /dev/null +++ b/tests/Feature/Http/Controllers/Staff/MediaLanguageControllerTest.php @@ -0,0 +1,107 @@ +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('staff.media_languages.create')); + + $response->assertOk(); + $response->assertViewIs('Staff.media_language.create'); + + // TODO: perform additional assertions +}); + +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.'); + + $mediaLanguage = \App\Models\MediaLanguage::factory()->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->delete(route('staff.media_languages.destroy', [$mediaLanguage])); + + $response->assertOk(); + $this->assertModelMissing($mediaLanguage); + + // TODO: perform additional assertions +}); + +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.'); + + $mediaLanguage = \App\Models\MediaLanguage::factory()->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->get(route('staff.media_languages.edit', [$mediaLanguage])); + + $response->assertOk(); + $response->assertViewIs('Staff.media_language.edit'); + $response->assertViewHas('media_language'); + + // 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.'); + + $mediaLanguages = \App\Models\MediaLanguage::factory()->times(3)->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->get(route('staff.media_languages.index')); + + $response->assertOk(); + $response->assertViewIs('Staff.media_language.index'); + $response->assertViewHas('media_languages'); + + // TODO: perform additional assertions +}); + +test('store validates with a form request', function (): void { + $this->assertActionUsesFormRequest( + \App\Http\Controllers\Staff\MediaLanguageController::class, + 'store', + \App\Http\Requests\Staff\StoreMediaLanguageRequest::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(); + + $response = $this->actingAs($user)->post(route('staff.media_languages.store'), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +test('update validates with a form request', function (): void { + $this->assertActionUsesFormRequest( + \App\Http\Controllers\Staff\MediaLanguageController::class, + 'update', + \App\Http\Requests\Staff\UpdateMediaLanguageRequest::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.'); + + $mediaLanguage = \App\Models\MediaLanguage::factory()->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->patch(route('staff.media_languages.update', [$mediaLanguage]), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +// test cases... diff --git a/tests/Feature/Http/Controllers/Staff/ModerationControllerTest.php b/tests/Feature/Http/Controllers/Staff/ModerationControllerTest.php new file mode 100644 index 000000000..dd393f9ed --- /dev/null +++ b/tests/Feature/Http/Controllers/Staff/ModerationControllerTest.php @@ -0,0 +1,46 @@ +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(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->get(route('staff.moderation.index')); + + $response->assertOk(); + $response->assertViewIs('Staff.moderation.index'); + $response->assertViewHas('current'); + $response->assertViewHas('pending'); + $response->assertViewHas('postponed'); + $response->assertViewHas('rejected'); + + // TODO: perform additional assertions +}); + +test('update validates with a form request', function (): void { + $this->assertActionUsesFormRequest( + \App\Http\Controllers\Staff\ModerationController::class, + 'update', + \App\Http\Requests\Staff\UpdateModerationRequest::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.'); + + $torrent = \App\Models\Torrent::factory()->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->post(route('staff.moderation.update', ['id' => $id]), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +// test cases... diff --git a/tests/Feature/Http/Controllers/Staff/NoteControllerTest.php b/tests/Feature/Http/Controllers/Staff/NoteControllerTest.php new file mode 100644 index 000000000..071cb2000 --- /dev/null +++ b/tests/Feature/Http/Controllers/Staff/NoteControllerTest.php @@ -0,0 +1,32 @@ +markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $note = \App\Models\Note::factory()->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->delete(route('staff.notes.destroy', [$note])); + + $response->assertOk(); + $this->assertModelMissing($note); + + // 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.'); + + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->get(route('staff.notes.index')); + + $response->assertOk(); + $response->assertViewIs('Staff.note.index'); + + // TODO: perform additional assertions +}); + +// test cases... diff --git a/tests/Feature/Http/Controllers/Staff/PageControllerTest.shift.php b/tests/Feature/Http/Controllers/Staff/PageControllerTest.shift.php new file mode 100644 index 000000000..17244763d --- /dev/null +++ b/tests/Feature/Http/Controllers/Staff/PageControllerTest.shift.php @@ -0,0 +1,107 @@ +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('staff.pages.create')); + + $response->assertOk(); + $response->assertViewIs('Staff.page.create'); + + // TODO: perform additional assertions +}); + +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.'); + + $page = \App\Models\Page::factory()->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->delete(route('staff.pages.destroy', [$page])); + + $response->assertOk(); + $this->assertModelMissing($page); + + // TODO: perform additional assertions +}); + +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.'); + + $page = \App\Models\Page::factory()->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->get(route('staff.pages.edit', [$page])); + + $response->assertOk(); + $response->assertViewIs('Staff.page.edit'); + $response->assertViewHas('page', $page); + + // 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.'); + + $pages = \App\Models\Page::factory()->times(3)->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->get(route('staff.pages.index')); + + $response->assertOk(); + $response->assertViewIs('Staff.page.index'); + $response->assertViewHas('pages', $pages); + + // TODO: perform additional assertions +}); + +test('store validates with a form request', function (): void { + $this->assertActionUsesFormRequest( + \App\Http\Controllers\Staff\PageController::class, + 'store', + \App\Http\Requests\Staff\StorePageRequest::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(); + + $response = $this->actingAs($user)->post(route('staff.pages.store'), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +test('update validates with a form request', function (): void { + $this->assertActionUsesFormRequest( + \App\Http\Controllers\Staff\PageController::class, + 'update', + \App\Http\Requests\Staff\UpdatePageRequest::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.'); + + $page = \App\Models\Page::factory()->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->patch(route('staff.pages.update', [$page]), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +// test cases... diff --git a/tests/Feature/Http/Controllers/Staff/PeerControllerTest.php b/tests/Feature/Http/Controllers/Staff/PeerControllerTest.php new file mode 100644 index 000000000..0847d096f --- /dev/null +++ b/tests/Feature/Http/Controllers/Staff/PeerControllerTest.php @@ -0,0 +1,18 @@ +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('staff.peers.index')); + + $response->assertOk(); + $response->assertViewIs('Staff.peer.index'); + + // TODO: perform additional assertions +}); + +// test cases... diff --git a/tests/Feature/Http/Controllers/Staff/PollControllerTest.php b/tests/Feature/Http/Controllers/Staff/PollControllerTest.php new file mode 100644 index 000000000..f9429e840 --- /dev/null +++ b/tests/Feature/Http/Controllers/Staff/PollControllerTest.php @@ -0,0 +1,122 @@ +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('staff.polls.create')); + + $response->assertOk(); + $response->assertViewIs('Staff.poll.create'); + + // TODO: perform additional assertions +}); + +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.'); + + $poll = \App\Models\Poll::factory()->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->delete(route('staff.polls.destroy', [$poll])); + + $response->assertOk(); + $this->assertModelMissing($poll); + + // TODO: perform additional assertions +}); + +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.'); + + $poll = \App\Models\Poll::factory()->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->get(route('staff.polls.edit', [$poll])); + + $response->assertOk(); + $response->assertViewIs('Staff.poll.edit'); + $response->assertViewHas('poll', $poll); + + // 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.'); + + $polls = \App\Models\Poll::factory()->times(3)->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->get(route('staff.polls.index')); + + $response->assertOk(); + $response->assertViewIs('Staff.poll.index'); + $response->assertViewHas('polls', $polls); + + // 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.'); + + $poll = \App\Models\Poll::factory()->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->get(route('staff.polls.show', [$poll])); + + $response->assertOk(); + $response->assertViewIs('Staff.poll.show'); + $response->assertViewHas('poll', $poll); + + // TODO: perform additional assertions +}); + +test('store validates with a form request', function (): void { + $this->assertActionUsesFormRequest( + \App\Http\Controllers\Staff\PollController::class, + 'store', + \App\Http\Requests\StorePoll::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(); + + $response = $this->actingAs($user)->post(route('staff.polls.store'), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +test('update validates with a form request', function (): void { + $this->assertActionUsesFormRequest( + \App\Http\Controllers\Staff\PollController::class, + 'update', + \App\Http\Requests\UpdatePollRequest::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.'); + + $poll = \App\Models\Poll::factory()->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->patch(route('staff.polls.update', [$poll]), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +// test cases... diff --git a/tests/Feature/Http/Controllers/Staff/RegionControllerTest.php b/tests/Feature/Http/Controllers/Staff/RegionControllerTest.php new file mode 100644 index 000000000..cc75d1148 --- /dev/null +++ b/tests/Feature/Http/Controllers/Staff/RegionControllerTest.php @@ -0,0 +1,115 @@ +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('staff.regions.create')); + + $response->assertOk(); + $response->assertViewIs('Staff.region.create'); + + // TODO: perform additional assertions +}); + +test('destroy validates with a form request', function (): void { + $this->assertActionUsesFormRequest( + \App\Http\Controllers\Staff\RegionController::class, + 'destroy', + \App\Http\Requests\Staff\DestroyRegionRequest::class + ); +}); + +test('destroy returns an ok response', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $region = \App\Models\Region::factory()->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->delete(route('staff.regions.destroy', [$region])); + + $response->assertOk(); + $this->assertModelMissing($region); + + // TODO: perform additional assertions +}); + +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.'); + + $region = \App\Models\Region::factory()->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->get(route('staff.regions.edit', [$region])); + + $response->assertOk(); + $response->assertViewIs('Staff.region.edit'); + $response->assertViewHas('region', $region); + + // 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.'); + + $regions = \App\Models\Region::factory()->times(3)->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->get(route('staff.regions.index')); + + $response->assertOk(); + $response->assertViewIs('Staff.region.index'); + $response->assertViewHas('regions', $regions); + + // TODO: perform additional assertions +}); + +test('store validates with a form request', function (): void { + $this->assertActionUsesFormRequest( + \App\Http\Controllers\Staff\RegionController::class, + 'store', + \App\Http\Requests\Staff\StoreRegionRequest::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(); + + $response = $this->actingAs($user)->post(route('staff.regions.store'), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +test('update validates with a form request', function (): void { + $this->assertActionUsesFormRequest( + \App\Http\Controllers\Staff\RegionController::class, + 'update', + \App\Http\Requests\Staff\UpdateRegionRequest::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.'); + + $region = \App\Models\Region::factory()->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->patch(route('staff.regions.update', [$region]), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +// test cases... diff --git a/tests/Feature/Http/Controllers/Staff/ReportControllerTest.php b/tests/Feature/Http/Controllers/Staff/ReportControllerTest.php new file mode 100644 index 000000000..977c4585f --- /dev/null +++ b/tests/Feature/Http/Controllers/Staff/ReportControllerTest.php @@ -0,0 +1,59 @@ +markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $reports = \App\Models\Report::factory()->times(3)->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->get(route('staff.reports.index')); + + $response->assertOk(); + $response->assertViewIs('Staff.report.index'); + $response->assertViewHas('reports', $reports); + + // 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.'); + + $report = \App\Models\Report::factory()->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->get(route('staff.reports.show', [$report])); + + $response->assertOk(); + $response->assertViewIs('Staff.report.show'); + $response->assertViewHas('report', $report); + $response->assertViewHas('urls'); + + // TODO: perform additional assertions +}); + +test('update validates with a form request', function (): void { + $this->assertActionUsesFormRequest( + \App\Http\Controllers\Staff\ReportController::class, + 'update', + \App\Http\Requests\Staff\UpdateReportRequest::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.'); + + $report = \App\Models\Report::factory()->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->patch(route('staff.reports.update', [$report]), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +// test cases... diff --git a/tests/Feature/Http/Controllers/Staff/ResolutionControllerTest.php b/tests/Feature/Http/Controllers/Staff/ResolutionControllerTest.php new file mode 100644 index 000000000..070e7ac6b --- /dev/null +++ b/tests/Feature/Http/Controllers/Staff/ResolutionControllerTest.php @@ -0,0 +1,107 @@ +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('staff.resolutions.create')); + + $response->assertOk(); + $response->assertViewIs('Staff.resolution.create'); + + // TODO: perform additional assertions +}); + +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.'); + + $resolution = \App\Models\Resolution::factory()->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->delete(route('staff.resolutions.destroy', [$resolution])); + + $response->assertOk(); + $this->assertModelMissing($resolution); + + // TODO: perform additional assertions +}); + +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.'); + + $resolution = \App\Models\Resolution::factory()->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->get(route('staff.resolutions.edit', [$resolution])); + + $response->assertOk(); + $response->assertViewIs('Staff.resolution.edit'); + $response->assertViewHas('resolution', $resolution); + + // 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.'); + + $resolutions = \App\Models\Resolution::factory()->times(3)->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->get(route('staff.resolutions.index')); + + $response->assertOk(); + $response->assertViewIs('Staff.resolution.index'); + $response->assertViewHas('resolutions', $resolutions); + + // TODO: perform additional assertions +}); + +test('store validates with a form request', function (): void { + $this->assertActionUsesFormRequest( + \App\Http\Controllers\Staff\ResolutionController::class, + 'store', + \App\Http\Requests\Staff\StoreResolutionRequest::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(); + + $response = $this->actingAs($user)->post(route('staff.resolutions.store'), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +test('update validates with a form request', function (): void { + $this->assertActionUsesFormRequest( + \App\Http\Controllers\Staff\ResolutionController::class, + 'update', + \App\Http\Requests\Staff\UpdateResolutionRequest::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.'); + + $resolution = \App\Models\Resolution::factory()->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->patch(route('staff.resolutions.update', [$resolution]), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +// test cases... diff --git a/tests/Feature/Http/Controllers/Staff/RssControllerTest.php b/tests/Feature/Http/Controllers/Staff/RssControllerTest.php new file mode 100644 index 000000000..5d3027e6c --- /dev/null +++ b/tests/Feature/Http/Controllers/Staff/RssControllerTest.php @@ -0,0 +1,170 @@ +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(); + + $response = $this->actingAs($user)->get(route('staff.rss.create')); + + $response->assertOk(); + $response->assertViewIs('Staff.rss.create'); + $response->assertViewHas('categories', $categories); + $response->assertViewHas('types', $types); + $response->assertViewHas('resolutions', $resolutions); + $response->assertViewHas('genres', $genres); + $response->assertViewHas('user', $user); + + // TODO: perform additional assertions +}); + +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(); + + $response = $this->actingAs($user)->delete(route('staff.rss.destroy', [$rss])); + + $response->assertOk(); + $this->assertModelMissing($rss); + + // TODO: perform additional assertions +}); + +test('destroy aborts with a 403', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $rss = \App\Models\Rss::factory()->create(); + $user = \App\Models\User::factory()->create(); + + // TODO: perform additional setup to trigger `abort_if(403)`... + + $response = $this->actingAs($user)->delete(route('staff.rss.destroy', [$rss])); + + $response->assertForbidden(); +}); + +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(); + + $response = $this->actingAs($user)->get(route('staff.rss.edit', [$rss])); + + $response->assertOk(); + $response->assertViewIs('Staff.rss.edit'); + $response->assertViewHas('categories', $categories); + $response->assertViewHas('types', $types); + $response->assertViewHas('resolutions', $resolutions); + $response->assertViewHas('genres', $genres); + $response->assertViewHas('user', $user); + $response->assertViewHas('rss', $rss); + + // TODO: perform additional assertions +}); + +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(); + + // TODO: perform additional setup to trigger `abort_if(403)`... + + $response = $this->actingAs($user)->get(route('staff.rss.edit', [$rss])); + + $response->assertForbidden(); +}); + +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(); + + $response = $this->actingAs($user)->get(route('staff.rss.index')); + + $response->assertOk(); + $response->assertViewIs('Staff.rss.index'); + $response->assertViewHas('public_rss'); + + // TODO: perform additional assertions +}); + +test('store validates with a form request', function (): void { + $this->assertActionUsesFormRequest( + \App\Http\Controllers\Staff\RssController::class, + 'store', + \App\Http\Requests\Staff\StoreRssRequest::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(); + + $response = $this->actingAs($user)->post(route('staff.rss.store'), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +test('update validates with a form request', function (): void { + $this->assertActionUsesFormRequest( + \App\Http\Controllers\Staff\RssController::class, + 'update', + \App\Http\Requests\Staff\UpdateRssRequest::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.'); + + $rss = \App\Models\Rss::factory()->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->patch(route('staff.rss.update', [$rss]), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // 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.'); + + $rss = \App\Models\Rss::factory()->create(); + $user = \App\Models\User::factory()->create(); + + // TODO: perform additional setup to trigger `abort_if(403)`... + + $response = $this->actingAs($user)->patch(route('staff.rss.update', [$rss]), [ + // TODO: send request data + ]); + + $response->assertForbidden(); +}); + +// test cases... diff --git a/tests/Feature/Http/Controllers/Staff/SeedboxControllerTest.php b/tests/Feature/Http/Controllers/Staff/SeedboxControllerTest.php new file mode 100644 index 000000000..c30c198ab --- /dev/null +++ b/tests/Feature/Http/Controllers/Staff/SeedboxControllerTest.php @@ -0,0 +1,34 @@ +markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $seedbox = \App\Models\Seedbox::factory()->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->delete(route('staff.seedboxes.destroy', [$seedbox])); + + $response->assertOk(); + $this->assertModelMissing($seedbox); + + // 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.'); + + $seedboxes = \App\Models\Seedbox::factory()->times(3)->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->get(route('staff.seedboxes.index')); + + $response->assertOk(); + $response->assertViewIs('Staff.seedbox.index'); + $response->assertViewHas('seedboxes', $seedboxes); + + // TODO: perform additional assertions +}); + +// test cases... diff --git a/tests/Feature/Http/Controllers/Staff/TypeControllerTest.shift.php b/tests/Feature/Http/Controllers/Staff/TypeControllerTest.shift.php new file mode 100644 index 000000000..11be9176a --- /dev/null +++ b/tests/Feature/Http/Controllers/Staff/TypeControllerTest.shift.php @@ -0,0 +1,107 @@ +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('staff.types.create')); + + $response->assertOk(); + $response->assertViewIs('Staff.type.create'); + + // TODO: perform additional assertions +}); + +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.'); + + $type = \App\Models\Type::factory()->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->delete(route('staff.types.destroy', [$type])); + + $response->assertOk(); + $this->assertModelMissing($type); + + // TODO: perform additional assertions +}); + +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.'); + + $type = \App\Models\Type::factory()->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->get(route('staff.types.edit', [$type])); + + $response->assertOk(); + $response->assertViewIs('Staff.type.edit'); + $response->assertViewHas('type', $type); + + // 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.'); + + $types = \App\Models\Type::factory()->times(3)->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->get(route('staff.types.index')); + + $response->assertOk(); + $response->assertViewIs('Staff.type.index'); + $response->assertViewHas('types', $types); + + // TODO: perform additional assertions +}); + +test('store validates with a form request', function (): void { + $this->assertActionUsesFormRequest( + \App\Http\Controllers\Staff\TypeController::class, + 'store', + \App\Http\Requests\Staff\StoreTypeRequest::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(); + + $response = $this->actingAs($user)->post(route('staff.types.store'), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +test('update validates with a form request', function (): void { + $this->assertActionUsesFormRequest( + \App\Http\Controllers\Staff\TypeController::class, + 'update', + \App\Http\Requests\Staff\UpdateTypeRequest::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.'); + + $type = \App\Models\Type::factory()->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->patch(route('staff.types.update', [$type]), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +// test cases... diff --git a/tests/Feature/Http/Controllers/Staff/UnbanControllerTest.php b/tests/Feature/Http/Controllers/Staff/UnbanControllerTest.php new file mode 100644 index 000000000..c01a3128e --- /dev/null +++ b/tests/Feature/Http/Controllers/Staff/UnbanControllerTest.php @@ -0,0 +1,43 @@ +assertActionUsesFormRequest( + \App\Http\Controllers\Staff\UnbanController::class, + 'store', + \App\Http\Requests\Staff\StoreUnbanRequest::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(); + + $response = $this->actingAs($authUser)->post(route('staff.unbans.store'), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +test('store aborts with a 403', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $user = \App\Models\User::factory()->create(); + $authUser = \App\Models\User::factory()->create(); + + // TODO: perform additional setup to trigger `abort_if(403)`... + + $response = $this->actingAs($authUser)->post(route('staff.unbans.store'), [ + // TODO: send request data + ]); + + $response->assertForbidden(); +}); + +// test cases... diff --git a/tests/Feature/Http/Controllers/Staff/UserControllerTest.php b/tests/Feature/Http/Controllers/Staff/UserControllerTest.php new file mode 100644 index 000000000..846fa6a57 --- /dev/null +++ b/tests/Feature/Http/Controllers/Staff/UserControllerTest.php @@ -0,0 +1,92 @@ +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(); + $groups = \App\Models\Group::factory()->times(3)->create(); + $internals = \App\Models\Internal::factory()->times(3)->create(); + $authUser = \App\Models\User::factory()->create(); + + $response = $this->actingAs($authUser)->get(route('staff.users.edit', [$user])); + + $response->assertOk(); + $response->assertViewIs('Staff.user.edit'); + $response->assertViewHas('user', $user); + $response->assertViewHas('groups', $groups); + $response->assertViewHas('internals', $internals); + + // 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.'); + + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->get(route('staff.users.index')); + + $response->assertOk(); + $response->assertViewIs('Staff.user.index'); + + // TODO: perform additional assertions +}); + +test('permissions 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)->patch(route('staff.users.update_permissions', [$user]), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +test('update validates with a form request', function (): void { + $this->assertActionUsesFormRequest( + \App\Http\Controllers\Staff\UserController::class, + 'update', + \App\Http\Requests\Staff\UpdateUserRequest::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.'); + + $user = \App\Models\User::factory()->create(); + $group = \App\Models\Group::factory()->create(); + $authUser = \App\Models\User::factory()->create(); + + $response = $this->actingAs($authUser)->patch(route('staff.users.update', [$user]), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // 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.'); + + $user = \App\Models\User::factory()->create(); + $group = \App\Models\Group::factory()->create(); + $authUser = \App\Models\User::factory()->create(); + + // TODO: perform additional setup to trigger `abort_if(403)`... + + $response = $this->actingAs($authUser)->patch(route('staff.users.update', [$user]), [ + // TODO: send request data + ]); + + $response->assertForbidden(); +}); + +// test cases... diff --git a/tests/Feature/Http/Controllers/Staff/VersionControllerTest.php b/tests/Feature/Http/Controllers/Staff/VersionControllerTest.php new file mode 100644 index 000000000..8591bafc6 --- /dev/null +++ b/tests/Feature/Http/Controllers/Staff/VersionControllerTest.php @@ -0,0 +1,17 @@ +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('staff.')); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +// test cases... diff --git a/tests/Feature/Http/Controllers/Staff/WarningControllerTest.php b/tests/Feature/Http/Controllers/Staff/WarningControllerTest.php new file mode 100644 index 000000000..73e389d4e --- /dev/null +++ b/tests/Feature/Http/Controllers/Staff/WarningControllerTest.php @@ -0,0 +1,18 @@ +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('staff.warnings.index')); + + $response->assertOk(); + $response->assertViewIs('Staff.warning.index'); + + // TODO: perform additional assertions +}); + +// test cases... diff --git a/tests/Feature/Http/Controllers/Staff/WatchlistControllerTest.php b/tests/Feature/Http/Controllers/Staff/WatchlistControllerTest.php new file mode 100644 index 000000000..d60dd3edf --- /dev/null +++ b/tests/Feature/Http/Controllers/Staff/WatchlistControllerTest.php @@ -0,0 +1,54 @@ +markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $watchlist = \App\Models\Watchlist::factory()->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->delete(route('staff.watchlist.destroy', [$watchlist])); + + $response->assertOk(); + $this->assertModelMissing($watchlist); + + // 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.'); + + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->get(route('staff.watchlist.index')); + + $response->assertOk(); + $response->assertViewIs('Staff.watchlist.index'); + + // TODO: perform additional assertions +}); + +test('store validates with a form request', function (): void { + $this->assertActionUsesFormRequest( + \App\Http\Controllers\Staff\WatchlistController::class, + 'store', + \App\Http\Requests\Staff\StoreWatchedUserRequest::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(); + + $response = $this->actingAs($user)->post(route('staff.watchlist.store'), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +// test cases... diff --git a/tests/Feature/Http/Controllers/StatsControllerTest.php b/tests/Feature/Http/Controllers/StatsControllerTest.php new file mode 100644 index 000000000..ae4a8e339 --- /dev/null +++ b/tests/Feature/Http/Controllers/StatsControllerTest.php @@ -0,0 +1,325 @@ +markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $users = \App\Models\User::factory()->times(3)->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->get(route('bankers')); + + $response->assertOk(); + $response->assertViewIs('stats.users.bankers'); + $response->assertViewHas('bankers'); + + // TODO: perform additional assertions +}); + +test('bountied 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.'); + + $torrentRequests = \App\Models\TorrentRequest::factory()->times(3)->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->get(route('bountied')); + + $response->assertOk(); + $response->assertViewIs('stats.requests.bountied'); + $response->assertViewHas('bountied'); + + // TODO: perform additional assertions +}); + +test('clients 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('clients')); + + $response->assertOk(); + $response->assertViewIs('stats.clients.clients'); + $response->assertViewHas('clients'); + + // TODO: perform additional assertions +}); + +test('completed 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(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->get(route('completed')); + + $response->assertOk(); + $response->assertViewIs('stats.torrents.completed'); + $response->assertViewHas('completed'); + + // TODO: perform additional assertions +}); + +test('dead 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(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->get(route('dead')); + + $response->assertOk(); + $response->assertViewIs('stats.torrents.dead'); + $response->assertViewHas('dead'); + + // TODO: perform additional assertions +}); + +test('downloaded 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.'); + + $users = \App\Models\User::factory()->times(3)->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->get(route('downloaded')); + + $response->assertOk(); + $response->assertViewIs('stats.users.downloaded'); + $response->assertViewHas('downloaded'); + + // TODO: perform additional assertions +}); + +test('dying 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(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->get(route('dying')); + + $response->assertOk(); + $response->assertViewIs('stats.torrents.dying'); + $response->assertViewHas('dying'); + + // TODO: perform additional assertions +}); + +test('group 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.'); + + $group = \App\Models\Group::factory()->create(); + $users = \App\Models\User::factory()->times(3)->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->get(route('group', ['id' => $id])); + + $response->assertOk(); + $response->assertViewIs('stats.groups.group'); + $response->assertViewHas('users', $users); + $response->assertViewHas('group', $group); + + // TODO: perform additional assertions +}); + +test('groups 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(); + + $response = $this->actingAs($user)->get(route('groups')); + + $response->assertOk(); + $response->assertViewIs('stats.groups.groups'); + $response->assertViewHas('groups', $groups); + + // 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.'); + + $categories = \App\Models\Category::factory()->times(3)->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->get(route('stats')); + + $response->assertOk(); + $response->assertViewIs('stats.index'); + $response->assertViewHas('all_user'); + $response->assertViewHas('active_user'); + $response->assertViewHas('disabled_user'); + $response->assertViewHas('pruned_user'); + $response->assertViewHas('banned_user'); + $response->assertViewHas('num_torrent'); + $response->assertViewHas('categories', $categories); + $response->assertViewHas('num_hd'); + $response->assertViewHas('num_sd'); + $response->assertViewHas('torrent_size'); + $response->assertViewHas('num_seeders'); + $response->assertViewHas('num_leechers'); + $response->assertViewHas('num_peers'); + $response->assertViewHas('actual_upload'); + $response->assertViewHas('actual_download'); + $response->assertViewHas('actual_up_down'); + $response->assertViewHas('credited_upload'); + $response->assertViewHas('credited_download'); + $response->assertViewHas('credited_up_down'); + + // TODO: perform additional assertions +}); + +test('languages 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('languages')); + + $response->assertOk(); + $response->assertViewIs('stats.languages.languages'); + $response->assertViewHas('languages'); + + // TODO: perform additional assertions +}); + +test('leeched 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(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->get(route('leeched')); + + $response->assertOk(); + $response->assertViewIs('stats.torrents.leeched'); + $response->assertViewHas('leeched'); + + // TODO: perform additional assertions +}); + +test('leechers 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.'); + + $peers = \App\Models\Peer::factory()->times(3)->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->get(route('leechers')); + + $response->assertOk(); + $response->assertViewIs('stats.users.leechers'); + $response->assertViewHas('leechers'); + + // TODO: perform additional assertions +}); + +test('seeded 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(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->get(route('seeded')); + + $response->assertOk(); + $response->assertViewIs('stats.torrents.seeded'); + $response->assertViewHas('seeded'); + + // TODO: perform additional assertions +}); + +test('seeders 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.'); + + $peers = \App\Models\Peer::factory()->times(3)->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->get(route('seeders')); + + $response->assertOk(); + $response->assertViewIs('stats.users.seeders'); + $response->assertViewHas('seeders'); + + // TODO: perform additional assertions +}); + +test('seedsize 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.'); + + $users = \App\Models\User::factory()->times(3)->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->get(route('seedsize')); + + $response->assertOk(); + $response->assertViewIs('stats.users.seedsize'); + $response->assertViewHas('users', $users); + + // TODO: perform additional assertions +}); + +test('seedtime 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.'); + + $users = \App\Models\User::factory()->times(3)->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->get(route('seedtime')); + + $response->assertOk(); + $response->assertViewIs('stats.users.seedtime'); + $response->assertViewHas('users', $users); + + // TODO: perform additional assertions +}); + +test('themes 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.'); + + $users = \App\Models\User::factory()->times(3)->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->get(route('themes')); + + $response->assertOk(); + $response->assertViewIs('stats.themes.index'); + $response->assertViewHas('siteThemes'); + $response->assertViewHas('customThemes'); + $response->assertViewHas('standaloneThemes'); + + // TODO: perform additional assertions +}); + +test('uploaded 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.'); + + $users = \App\Models\User::factory()->times(3)->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->get(route('uploaded')); + + $response->assertOk(); + $response->assertViewIs('stats.users.uploaded'); + $response->assertViewHas('uploaded'); + + // TODO: perform additional assertions +}); + +test('uploaders 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(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->get(route('uploaders')); + + $response->assertOk(); + $response->assertViewIs('stats.users.uploaders'); + $response->assertViewHas('uploaders'); + + // TODO: perform additional assertions +}); + +// test cases... diff --git a/tests/Feature/Http/Controllers/SubscriptionControllerTest.php b/tests/Feature/Http/Controllers/SubscriptionControllerTest.php new file mode 100644 index 000000000..aee1d76d5 --- /dev/null +++ b/tests/Feature/Http/Controllers/SubscriptionControllerTest.php @@ -0,0 +1,91 @@ +markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $subscription = \App\Models\Subscription::factory()->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->post(route('subscriptions.destroy', ['id' => $subscription->id]), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +test('destroy aborts with a 403', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $subscription = \App\Models\Subscription::factory()->create(); + $user = \App\Models\User::factory()->create(); + + // TODO: perform additional setup to trigger `abort_unless(403)`... + + $response = $this->actingAs($user)->post(route('subscriptions.destroy', ['id' => $subscription->id]), [ + // TODO: send request data + ]); + + $response->assertForbidden(); +}); + +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('subscriptions.index')); + + $response->assertOk(); + $response->assertViewIs('forum.subscriptions'); + $response->assertViewHas('user', $user); + + // 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(); + + $response = $this->actingAs($user)->post(route('subscriptions.store'), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +test('store aborts with a 403', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $user = \App\Models\User::factory()->create(); + + // TODO: perform additional setup to trigger `abort_unless(403)`... + + $response = $this->actingAs($user)->post(route('subscriptions.store'), [ + // TODO: send request data + ]); + + $response->assertForbidden(); +}); + +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(); + + // TODO: perform additional setup to trigger `abort_unless(403)`... + + $response = $this->actingAs($user)->post(route('subscriptions.store'), [ + // TODO: send request data + ]); + + $response->assertForbidden(); +}); + +// test cases... diff --git a/tests/Feature/Http/Controllers/SubtitleControllerTest.php b/tests/Feature/Http/Controllers/SubtitleControllerTest.php new file mode 100644 index 000000000..19fc8c9a6 --- /dev/null +++ b/tests/Feature/Http/Controllers/SubtitleControllerTest.php @@ -0,0 +1,136 @@ +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(); + $mediaLanguages = \App\Models\MediaLanguage::factory()->times(3)->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->get(route('subtitles.create')); + + $response->assertOk(); + $response->assertViewIs('subtitle.create'); + $response->assertViewHas('torrent', $torrent); + $response->assertViewHas('media_languages'); + + // TODO: perform additional assertions +}); + +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.'); + + $subtitle = \App\Models\Subtitle::factory()->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->delete(route('subtitles.destroy', [$subtitle])); + + $response->assertOk(); + $this->assertModelMissing($subtitle); + + // TODO: perform additional assertions +}); + +test('destroy aborts with a 403', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $subtitle = \App\Models\Subtitle::factory()->create(); + $user = \App\Models\User::factory()->create(); + + // TODO: perform additional setup to trigger `abort_unless(403)`... + + $response = $this->actingAs($user)->delete(route('subtitles.destroy', [$subtitle])); + + $response->assertForbidden(); +}); + +test('download 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.'); + + $subtitle = \App\Models\Subtitle::factory()->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->get(route('subtitles.download', [$subtitle])); + + $response->assertOk(); + + // 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.'); + + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->get(route('subtitles.index')); + + $response->assertOk(); + $response->assertViewIs('subtitle.index'); + + // TODO: perform additional assertions +}); + +test('store validates with a form request', function (): void { + $this->assertActionUsesFormRequest( + \App\Http\Controllers\SubtitleController::class, + 'store', + \App\Http\Requests\StoreSubtitleRequest::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.'); + + $torrent = \App\Models\Torrent::factory()->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->post(route('subtitles.store'), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +test('update validates with a form request', function (): void { + $this->assertActionUsesFormRequest( + \App\Http\Controllers\SubtitleController::class, + 'update', + \App\Http\Requests\UpdateSubtitleRequest::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.'); + + $subtitle = \App\Models\Subtitle::factory()->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->patch(route('subtitles.update', [$subtitle]), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // 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.'); + + $subtitle = \App\Models\Subtitle::factory()->create(); + $user = \App\Models\User::factory()->create(); + + // TODO: perform additional setup to trigger `abort_unless(403)`... + + $response = $this->actingAs($user)->patch(route('subtitles.update', [$subtitle]), [ + // TODO: send request data + ]); + + $response->assertForbidden(); +}); + +// test cases... diff --git a/tests/Feature/Http/Controllers/TicketAssigneeControllerTest.php b/tests/Feature/Http/Controllers/TicketAssigneeControllerTest.php new file mode 100644 index 000000000..4e5cd8d1a --- /dev/null +++ b/tests/Feature/Http/Controllers/TicketAssigneeControllerTest.php @@ -0,0 +1,62 @@ +markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $ticket = \App\Models\Ticket::factory()->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->delete(route('tickets.assignee.destroy', [$ticket])); + + $response->assertOk(); + $this->assertModelMissing($ticket); + + // TODO: perform additional assertions +}); + +test('destroy aborts with a 403', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $ticket = \App\Models\Ticket::factory()->create(); + $user = \App\Models\User::factory()->create(); + + // TODO: perform additional setup to trigger `abort_unless(403)`... + + $response = $this->actingAs($user)->delete(route('tickets.assignee.destroy', [$ticket])); + + $response->assertForbidden(); +}); + +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.'); + + $ticket = \App\Models\Ticket::factory()->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->post(route('tickets.assignee.store', [$ticket]), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +test('store aborts with a 403', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $ticket = \App\Models\Ticket::factory()->create(); + $user = \App\Models\User::factory()->create(); + + // TODO: perform additional setup to trigger `abort_unless(403)`... + + $response = $this->actingAs($user)->post(route('tickets.assignee.store', [$ticket]), [ + // TODO: send request data + ]); + + $response->assertForbidden(); +}); + +// test cases... diff --git a/tests/Feature/Http/Controllers/TicketAttachmentControllerTest.php b/tests/Feature/Http/Controllers/TicketAttachmentControllerTest.php new file mode 100644 index 000000000..380bb2989 --- /dev/null +++ b/tests/Feature/Http/Controllers/TicketAttachmentControllerTest.php @@ -0,0 +1,37 @@ +markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $ticket = \App\Models\Ticket::factory()->create(); + $ticketAttachment = \App\Models\TicketAttachment::factory()->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->post(route('tickets.attachment.download', [$ticket, 'attachment' => $ticketAttachment->attachment]), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +test('download 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.'); + + $ticket = \App\Models\Ticket::factory()->create(); + $ticketAttachment = \App\Models\TicketAttachment::factory()->create(); + $user = \App\Models\User::factory()->create(); + + // TODO: perform additional setup to trigger `abort_unless(403)`... + + $response = $this->actingAs($user)->post(route('tickets.attachment.download', [$ticket, 'attachment' => $ticketAttachment->attachment]), [ + // TODO: send request data + ]); + + $response->assertForbidden(); +}); + +// test cases... diff --git a/tests/Feature/Http/Controllers/TicketControllerTest.php b/tests/Feature/Http/Controllers/TicketControllerTest.php new file mode 100644 index 000000000..c80fc7a31 --- /dev/null +++ b/tests/Feature/Http/Controllers/TicketControllerTest.php @@ -0,0 +1,143 @@ +markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $ticket = \App\Models\Ticket::factory()->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->post(route('tickets.close', [$ticket]), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +test('close 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.'); + + $ticket = \App\Models\Ticket::factory()->create(); + $user = \App\Models\User::factory()->create(); + + // TODO: perform additional setup to trigger `abort_unless(403)`... + + $response = $this->actingAs($user)->post(route('tickets.close', [$ticket]), [ + // TODO: send request data + ]); + + $response->assertForbidden(); +}); + +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.'); + + $ticketCategories = \App\Models\TicketCategory::factory()->times(3)->create(); + $ticketPriorities = \App\Models\TicketPriority::factory()->times(3)->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->get(route('tickets.create')); + + $response->assertOk(); + $response->assertViewIs('ticket.create'); + $response->assertViewHas('categories'); + $response->assertViewHas('priorities'); + + // TODO: perform additional assertions +}); + +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.'); + + $ticket = \App\Models\Ticket::factory()->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->delete(route('tickets.destroy', [$ticket])); + + $response->assertOk(); + $this->assertModelMissing($ticket); + + // TODO: perform additional assertions +}); + +test('destroy aborts with a 403', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $ticket = \App\Models\Ticket::factory()->create(); + $user = \App\Models\User::factory()->create(); + + // TODO: perform additional setup to trigger `abort_unless(403)`... + + $response = $this->actingAs($user)->delete(route('tickets.destroy', [$ticket])); + + $response->assertForbidden(); +}); + +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('tickets.index')); + + $response->assertOk(); + $response->assertViewIs('ticket.index'); + + // 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.'); + + $ticket = \App\Models\Ticket::factory()->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->get(route('tickets.show', [$ticket])); + + $response->assertOk(); + $response->assertViewIs('ticket.show'); + $response->assertViewHas('user', $user); + $response->assertViewHas('ticket', $ticket); + + // TODO: perform additional assertions +}); + +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.'); + + $ticket = \App\Models\Ticket::factory()->create(); + $user = \App\Models\User::factory()->create(); + + // TODO: perform additional setup to trigger `abort_unless(403)`... + + $response = $this->actingAs($user)->get(route('tickets.show', [$ticket])); + + $response->assertForbidden(); +}); + +test('store validates with a form request', function (): void { + $this->assertActionUsesFormRequest( + \App\Http\Controllers\TicketController::class, + 'store', + \App\Http\Requests\StoreTicketRequest::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(); + + $response = $this->actingAs($user)->post(route('tickets.store'), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +// test cases... diff --git a/tests/Feature/Http/Controllers/Top10ControllerTest.php b/tests/Feature/Http/Controllers/Top10ControllerTest.php new file mode 100644 index 000000000..04c44311d --- /dev/null +++ b/tests/Feature/Http/Controllers/Top10ControllerTest.php @@ -0,0 +1,18 @@ +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('top10.index')); + + $response->assertOk(); + $response->assertViewIs('top10.index'); + + // TODO: perform additional assertions +}); + +// test cases... diff --git a/tests/Feature/Http/Controllers/TopicControllerTest.php b/tests/Feature/Http/Controllers/TopicControllerTest.php new file mode 100644 index 000000000..367a3db47 --- /dev/null +++ b/tests/Feature/Http/Controllers/TopicControllerTest.php @@ -0,0 +1,203 @@ +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(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->post(route('topics.close', ['id' => $topic->id]), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +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.'); + + $forum = \App\Models\Forum::factory()->create(); + $topic = \App\Models\Topic::factory()->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->get(route('topics.create', ['id' => $topic->id])); + + $response->assertOk(); + $response->assertViewIs('forum.forum_topic.create'); + $response->assertViewHas('forum', $forum); + + // TODO: perform additional assertions +}); + +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.'); + + $topic = \App\Models\Topic::factory()->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->delete(route('topics.destroy', ['id' => $topic->id])); + + $response->assertOk(); + $this->assertModelMissing($topic); + + // TODO: perform additional assertions +}); + +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.'); + + $topic = \App\Models\Topic::factory()->create(); + $forums = \App\Models\Forum::factory()->times(3)->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->get(route('topics.edit', ['id' => $topic->id])); + + $response->assertOk(); + $response->assertViewIs('forum.topic.edit'); + $response->assertViewHas('topic', $topic); + $response->assertViewHas('categories'); + + // TODO: perform additional assertions +}); + +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.'); + + $topic = \App\Models\Topic::factory()->create(); + $forums = \App\Models\Forum::factory()->times(3)->create(); + $user = \App\Models\User::factory()->create(); + + // TODO: perform additional setup to trigger `abort_unless(403)`... + + $response = $this->actingAs($user)->get(route('topics.edit', ['id' => $topic->id])); + + $response->assertForbidden(); +}); + +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('topics.index')); + + $response->assertOk(); + $response->assertViewIs('forum.topic.index'); + + // TODO: perform additional assertions +}); + +test('open 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(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->post(route('topics.open', ['id' => $topic->id]), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +test('pin 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(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->post(route('topics.pin', ['id' => $topic->id]), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // 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.'); + + $topic = \App\Models\Topic::factory()->create(); + $subscription = \App\Models\Subscription::factory()->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->get(route('topics.show', ['id' => $topic->id])); + + $response->assertOk(); + $response->assertViewIs('forum.topic.show'); + $response->assertViewHas('topic', $topic); + $response->assertViewHas('forum'); + $response->assertViewHas('subscription', $subscription); + + // 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.'); + + $forum = \App\Models\Forum::factory()->create(); + $topic = \App\Models\Topic::factory()->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->post(route('topics.store', ['id' => $topic->id]), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +test('unpin 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(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->post(route('topics.unpin', ['id' => $topic->id]), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +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.'); + + $topic = \App\Models\Topic::factory()->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->patch(route('topics.update', ['id' => $topic->id]), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // 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.'); + + $topic = \App\Models\Topic::factory()->create(); + $user = \App\Models\User::factory()->create(); + + // TODO: perform additional setup to trigger `abort_unless(403)`... + + $response = $this->actingAs($user)->patch(route('topics.update', ['id' => $topic->id]), [ + // TODO: send request data + ]); + + $response->assertForbidden(); +}); + +// test cases... diff --git a/tests/Feature/Http/Controllers/TopicLabelControllerTest.php b/tests/Feature/Http/Controllers/TopicLabelControllerTest.php new file mode 100644 index 000000000..5e2f4e5a4 --- /dev/null +++ b/tests/Feature/Http/Controllers/TopicLabelControllerTest.php @@ -0,0 +1,110 @@ +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(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->post(route('topics.approve', ['id' => $id]), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +test('bug 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(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->post(route('topics.bug', ['id' => $id]), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +test('deny 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(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->post(route('topics.deny', ['id' => $id]), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +test('implement 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(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->post(route('topics.implement', ['id' => $id]), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +test('invalid 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(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->post(route('topics.invalid', ['id' => $id]), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +test('solve 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(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->post(route('topics.solve', ['id' => $id]), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +test('suggest 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(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->post(route('topics.suggest', ['id' => $id]), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +// test cases... diff --git a/tests/Feature/Http/Controllers/TorrentBuffControllerTest.php b/tests/Feature/Http/Controllers/TorrentBuffControllerTest.php new file mode 100644 index 000000000..d7948c14b --- /dev/null +++ b/tests/Feature/Http/Controllers/TorrentBuffControllerTest.php @@ -0,0 +1,230 @@ +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(); + + $response = $this->actingAs($user)->post(route('bumpTorrent', ['id' => $id]), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +test('bump torrent 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.'); + + $torrent = \App\Models\Torrent::factory()->create(); + $user = \App\Models\User::factory()->create(); + + // TODO: perform additional setup to trigger `abort_unless(403)`... + + $response = $this->actingAs($user)->post(route('bumpTorrent', ['id' => $id]), [ + // TODO: send request data + ]); + + $response->assertForbidden(); +}); + +test('freeleech token 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(); + + $response = $this->actingAs($user)->post(route('freeleech_token', ['id' => $id]), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +test('grant double up 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(); + + $response = $this->actingAs($user)->post(route('torrent_doubleup', ['id' => $id]), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +test('grant double up 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.'); + + $torrent = \App\Models\Torrent::factory()->create(); + $user = \App\Models\User::factory()->create(); + + // TODO: perform additional setup to trigger `abort_unless(403)`... + + $response = $this->actingAs($user)->post(route('torrent_doubleup', ['id' => $id]), [ + // TODO: send request data + ]); + + $response->assertForbidden(); +}); + +test('grant f l 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(); + + $response = $this->actingAs($user)->post(route('torrent_fl', ['id' => $id]), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +test('grant f l 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.'); + + $torrent = \App\Models\Torrent::factory()->create(); + $user = \App\Models\User::factory()->create(); + + // TODO: perform additional setup to trigger `abort_unless(403)`... + + $response = $this->actingAs($user)->post(route('torrent_fl', ['id' => $id]), [ + // TODO: send request data + ]); + + $response->assertForbidden(); +}); + +test('grant featured 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(); + + $response = $this->actingAs($user)->post(route('torrent_feature', ['id' => $id]), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +test('grant featured 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.'); + + $torrent = \App\Models\Torrent::factory()->create(); + $user = \App\Models\User::factory()->create(); + + // TODO: perform additional setup to trigger `abort_unless(403)`... + + $response = $this->actingAs($user)->post(route('torrent_feature', ['id' => $id]), [ + // TODO: send request data + ]); + + $response->assertForbidden(); +}); + +test('revoke featured 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(); + + $response = $this->actingAs($user)->post(route('torrent_revokefeature', ['id' => $id]), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +test('revoke featured 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.'); + + $torrent = \App\Models\Torrent::factory()->create(); + $user = \App\Models\User::factory()->create(); + + // TODO: perform additional setup to trigger `abort_unless(403)`... + + $response = $this->actingAs($user)->post(route('torrent_revokefeature', ['id' => $id]), [ + // TODO: send request data + ]); + + $response->assertForbidden(); +}); + +test('set refundable 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(); + + $response = $this->actingAs($user)->post(route('refundable', ['id' => $id]), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +test('set refundable 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.'); + + $torrent = \App\Models\Torrent::factory()->create(); + $user = \App\Models\User::factory()->create(); + + // TODO: perform additional setup to trigger `abort_unless(403)`... + + $response = $this->actingAs($user)->post(route('refundable', ['id' => $id]), [ + // TODO: send request data + ]); + + $response->assertForbidden(); +}); + +test('sticky 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(); + + $response = $this->actingAs($user)->post(route('torrent_sticky', ['id' => $id]), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +test('sticky 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.'); + + $torrent = \App\Models\Torrent::factory()->create(); + $user = \App\Models\User::factory()->create(); + + // TODO: perform additional setup to trigger `abort_unless(403)`... + + $response = $this->actingAs($user)->post(route('torrent_sticky', ['id' => $id]), [ + // TODO: send request data + ]); + + $response->assertForbidden(); +}); + +// test cases... diff --git a/tests/Feature/Http/Controllers/TorrentControllerTest.php b/tests/Feature/Http/Controllers/TorrentControllerTest.php new file mode 100644 index 000000000..db15e538e --- /dev/null +++ b/tests/Feature/Http/Controllers/TorrentControllerTest.php @@ -0,0 +1,215 @@ +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(); + $regions = \App\Models\Region::factory()->times(3)->create(); + $distributors = \App\Models\Distributor::factory()->times(3)->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->get(route('torrents.create')); + + $response->assertOk(); + $response->assertViewIs('torrent.create'); + $response->assertViewHas('categories', $categories); + $response->assertViewHas('types', $types); + $response->assertViewHas('resolutions', $resolutions); + $response->assertViewHas('regions', $regions); + $response->assertViewHas('distributors', $distributors); + $response->assertViewHas('user', $user); + $response->assertViewHas('category_id'); + $response->assertViewHas('title'); + $response->assertViewHas('imdb'); + $response->assertViewHas('tmdb'); + $response->assertViewHas('mal'); + $response->assertViewHas('tvdb'); + $response->assertViewHas('igdb'); + + // TODO: perform additional assertions +}); + +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.'); + + $torrent = \App\Models\Torrent::factory()->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->delete(route('torrents.destroy', ['id' => $torrent->id])); + + $response->assertOk(); + $this->assertModelMissing($torrent); + + // TODO: perform additional assertions +}); + +test('destroy aborts with a 403', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $torrent = \App\Models\Torrent::factory()->create(); + $user = \App\Models\User::factory()->create(); + + // TODO: perform additional setup to trigger `abort_unless(403)`... + + $response = $this->actingAs($user)->delete(route('torrents.destroy', ['id' => $torrent->id])); + + $response->assertForbidden(); +}); + +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.'); + + $torrent = \App\Models\Torrent::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(); + $regions = \App\Models\Region::factory()->times(3)->create(); + $distributors = \App\Models\Distributor::factory()->times(3)->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->get(route('torrents.edit', ['id' => $torrent->id])); + + $response->assertOk(); + $response->assertViewIs('torrent.edit'); + $response->assertViewHas('categories', $categories); + $response->assertViewHas('types', $types); + $response->assertViewHas('resolutions', $resolutions); + $response->assertViewHas('regions', $regions); + $response->assertViewHas('distributors', $distributors); + $response->assertViewHas('keywords'); + $response->assertViewHas('torrent', $torrent); + $response->assertViewHas('user', $user); + + // TODO: perform additional assertions +}); + +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.'); + + $torrent = \App\Models\Torrent::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(); + $regions = \App\Models\Region::factory()->times(3)->create(); + $distributors = \App\Models\Distributor::factory()->times(3)->create(); + $user = \App\Models\User::factory()->create(); + + // TODO: perform additional setup to trigger `abort_unless(403)`... + + $response = $this->actingAs($user)->get(route('torrents.edit', ['id' => $torrent->id])); + + $response->assertForbidden(); +}); + +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('torrents.index')); + + $response->assertOk(); + $response->assertViewIs('torrent.index'); + + // 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(); + $tv = \App\Models\Tv::factory()->create(); + $movie = \App\Models\Movie::factory()->create(); + $featuredTorrent = \App\Models\FeaturedTorrent::factory()->create(); + $history = \App\Models\History::factory()->create(); + $audits = \App\Models\Audit::factory()->times(3)->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->get(route('torrents.show', ['id' => $torrent->id])); + + $response->assertOk(); + $response->assertViewIs('torrent.show'); + $response->assertViewHas('torrent', $torrent); + $response->assertViewHas('user', $user); + $response->assertViewHas('personal_freeleech'); + $response->assertViewHas('freeleech_token'); + $response->assertViewHas('meta'); + $response->assertViewHas('trailer'); + $response->assertViewHas('platforms'); + $response->assertViewHas('total_tips'); + $response->assertViewHas('user_tips'); + $response->assertViewHas('featured'); + $response->assertViewHas('mediaInfo'); + $response->assertViewHas('last_seed_activity'); + $response->assertViewHas('playlists'); + $response->assertViewHas('audits', $audits); + + // TODO: perform additional assertions +}); + +test('store validates with a form request', function (): void { + $this->assertActionUsesFormRequest( + \App\Http\Controllers\TorrentController::class, + 'store', + \App\Http\Requests\StoreTorrentRequest::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.'); + + $category = \App\Models\Category::factory()->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->post(route('torrents.store'), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +test('update validates with a form request', function (): void { + $this->assertActionUsesFormRequest( + \App\Http\Controllers\TorrentController::class, + 'update', + \App\Http\Requests\UpdateTorrentRequest::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.'); + + $torrent = \App\Models\Torrent::factory()->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->patch(route('torrents.update', ['id' => $torrent->id]), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // 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.'); + + $torrent = \App\Models\Torrent::factory()->create(); + $user = \App\Models\User::factory()->create(); + + // TODO: perform additional setup to trigger `abort_unless(403)`... + + $response = $this->actingAs($user)->patch(route('torrents.update', ['id' => $torrent->id]), [ + // TODO: send request data + ]); + + $response->assertForbidden(); +}); + +// test cases... diff --git a/tests/Feature/Http/Controllers/TorrentDownloadControllerTest.php b/tests/Feature/Http/Controllers/TorrentDownloadControllerTest.php new file mode 100644 index 000000000..3a43710c5 --- /dev/null +++ b/tests/Feature/Http/Controllers/TorrentDownloadControllerTest.php @@ -0,0 +1,36 @@ +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(); + $torrentDownload = \App\Models\TorrentDownload::factory()->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->get(route('download_check', ['id' => $torrentDownload->id])); + + $response->assertOk(); + $response->assertViewIs('torrent.download_check'); + $response->assertViewHas('torrent', $torrent); + $response->assertViewHas('user', $user); + + // 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.'); + + $torrent = \App\Models\Torrent::factory()->create(); + $torrentDownload = \App\Models\TorrentDownload::factory()->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->get(route('download', ['id' => $torrentDownload->id])); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +// test cases... diff --git a/tests/Feature/Http/Controllers/TorrentHistoryControllerTest.php b/tests/Feature/Http/Controllers/TorrentHistoryControllerTest.php new file mode 100644 index 000000000..2165e6fb4 --- /dev/null +++ b/tests/Feature/Http/Controllers/TorrentHistoryControllerTest.php @@ -0,0 +1,22 @@ +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(); + $histories = \App\Models\History::factory()->times(3)->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->get(route('history', ['id' => $id])); + + $response->assertOk(); + $response->assertViewIs('torrent.history'); + $response->assertViewHas('torrent', $torrent); + $response->assertViewHas('histories', $histories); + + // TODO: perform additional assertions +}); + +// test cases... diff --git a/tests/Feature/Http/Controllers/TorrentPeerControllerTest.php b/tests/Feature/Http/Controllers/TorrentPeerControllerTest.php new file mode 100644 index 000000000..6a2d1e0e2 --- /dev/null +++ b/tests/Feature/Http/Controllers/TorrentPeerControllerTest.php @@ -0,0 +1,22 @@ +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(); + $peers = \App\Models\Peer::factory()->times(3)->create(); + $user = \App\Models\User::factory()->create(); + + $response = $this->actingAs($user)->get(route('peers', ['id' => $id])); + + $response->assertOk(); + $response->assertViewIs('torrent.peers'); + $response->assertViewHas('torrent', $torrent); + $response->assertViewHas('peers', $peers); + + // TODO: perform additional assertions +}); + +// test cases... diff --git a/tests/Feature/Http/Controllers/User/AchievementsControllerTest.php b/tests/Feature/Http/Controllers/User/AchievementsControllerTest.php new file mode 100644 index 000000000..1ae307037 --- /dev/null +++ b/tests/Feature/Http/Controllers/User/AchievementsControllerTest.php @@ -0,0 +1,23 @@ +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)->get(route('users.achievements.index', [$user])); + + $response->assertOk(); + $response->assertViewIs('user.achievement.index'); + $response->assertViewHas('route'); + $response->assertViewHas('user', $user); + $response->assertViewHas('achievements'); + $response->assertViewHas('pending'); + + // TODO: perform additional assertions +}); + +// test cases... diff --git a/tests/Feature/Http/Controllers/User/ApikeyControllerTest.php b/tests/Feature/Http/Controllers/User/ApikeyControllerTest.php new file mode 100644 index 000000000..86ec8fe12 --- /dev/null +++ b/tests/Feature/Http/Controllers/User/ApikeyControllerTest.php @@ -0,0 +1,33 @@ +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)->get(route('users.apikey.edit', [$user])); + + $response->assertOk(); + $response->assertViewIs('user.apikey.edit'); + $response->assertViewHas('user', $user); + + // TODO: perform additional assertions +}); + +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.'); + + $user = \App\Models\User::factory()->create(); + $authUser = \App\Models\User::factory()->create(); + + // TODO: perform additional setup to trigger `abort_unless(403)`... + + $response = $this->actingAs($authUser)->get(route('users.apikey.edit', [$user])); + + $response->assertForbidden(); +}); + +// test cases... diff --git a/tests/Feature/Http/Controllers/User/EarningControllerTest.php b/tests/Feature/Http/Controllers/User/EarningControllerTest.php new file mode 100644 index 000000000..8ac9bee55 --- /dev/null +++ b/tests/Feature/Http/Controllers/User/EarningControllerTest.php @@ -0,0 +1,46 @@ +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)->get(route('users.earnings.index', [$user])); + + $response->assertOk(); + $response->assertViewIs('user.earning.index'); + $response->assertViewHas('user', $user); + $response->assertViewHas('bon'); + $response->assertViewHas('dying'); + $response->assertViewHas('legendary'); + $response->assertViewHas('old'); + $response->assertViewHas('huge'); + $response->assertViewHas('large'); + $response->assertViewHas('regular'); + $response->assertViewHas('participant'); + $response->assertViewHas('teamplayer'); + $response->assertViewHas('committed'); + $response->assertViewHas('mvp'); + $response->assertViewHas('legend'); + $response->assertViewHas('total'); + + // TODO: perform additional assertions +}); + +test('index 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(); + + // TODO: perform additional setup to trigger `abort_unless(403)`... + + $response = $this->actingAs($authUser)->get(route('users.earnings.index', [$user])); + + $response->assertForbidden(); +}); + +// test cases... diff --git a/tests/Feature/Http/Controllers/User/EmailControllerTest.php b/tests/Feature/Http/Controllers/User/EmailControllerTest.php new file mode 100644 index 000000000..7c3d6d36d --- /dev/null +++ b/tests/Feature/Http/Controllers/User/EmailControllerTest.php @@ -0,0 +1,33 @@ +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)->get(route('users.email.edit', [$user])); + + $response->assertOk(); + $response->assertViewIs('user.email.edit'); + $response->assertViewHas('user', $user); + + // TODO: perform additional assertions +}); + +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.'); + + $user = \App\Models\User::factory()->create(); + $authUser = \App\Models\User::factory()->create(); + + // TODO: perform additional setup to trigger `abort_unless(403)`... + + $response = $this->actingAs($authUser)->get(route('users.email.edit', [$user])); + + $response->assertForbidden(); +}); + +// test cases... diff --git a/tests/Feature/Http/Controllers/User/FollowControllerTest.php b/tests/Feature/Http/Controllers/User/FollowControllerTest.php new file mode 100644 index 000000000..59a0033c6 --- /dev/null +++ b/tests/Feature/Http/Controllers/User/FollowControllerTest.php @@ -0,0 +1,50 @@ +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)->delete(route('users.followers.destroy', [$user])); + + $response->assertOk(); + $this->assertModelMissing($user); + + // 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.'); + + $user = \App\Models\User::factory()->create(); + $authUser = \App\Models\User::factory()->create(); + + $response = $this->actingAs($authUser)->get(route('users.followers.index', [$user])); + + $response->assertOk(); + $response->assertViewIs('user.follower.index'); + $response->assertViewHas('followers'); + $response->assertViewHas('user', $user); + + // 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('users.followers.store', [$user]), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +// test cases... diff --git a/tests/Feature/Http/Controllers/User/FollowingControllerTest.php b/tests/Feature/Http/Controllers/User/FollowingControllerTest.php new file mode 100644 index 000000000..f4c9d3507 --- /dev/null +++ b/tests/Feature/Http/Controllers/User/FollowingControllerTest.php @@ -0,0 +1,21 @@ +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)->get(route('users.following.index', [$user])); + + $response->assertOk(); + $response->assertViewIs('user.following.index'); + $response->assertViewHas('followings'); + $response->assertViewHas('user', $user); + + // TODO: perform additional assertions +}); + +// test cases... diff --git a/tests/Feature/Http/Controllers/User/GeneralSettingControllerTest.php b/tests/Feature/Http/Controllers/User/GeneralSettingControllerTest.php new file mode 100644 index 000000000..2cb24e46d --- /dev/null +++ b/tests/Feature/Http/Controllers/User/GeneralSettingControllerTest.php @@ -0,0 +1,63 @@ +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)->get(route('users.general_settings.edit', [$user])); + + $response->assertOk(); + $response->assertViewIs('user.general_setting.edit'); + $response->assertViewHas('user', $user); + + // TODO: perform additional assertions +}); + +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.'); + + $user = \App\Models\User::factory()->create(); + $authUser = \App\Models\User::factory()->create(); + + // TODO: perform additional setup to trigger `abort_unless(403)`... + + $response = $this->actingAs($authUser)->get(route('users.general_settings.edit', [$user])); + + $response->assertForbidden(); +}); + +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.'); + + $user = \App\Models\User::factory()->create(); + $authUser = \App\Models\User::factory()->create(); + + $response = $this->actingAs($authUser)->patch(route('users.general_settings.update', [$user]), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // 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.'); + + $user = \App\Models\User::factory()->create(); + $authUser = \App\Models\User::factory()->create(); + + // TODO: perform additional setup to trigger `abort_unless(403)`... + + $response = $this->actingAs($authUser)->patch(route('users.general_settings.update', [$user]), [ + // TODO: send request data + ]); + + $response->assertForbidden(); +}); + +// test cases... diff --git a/tests/Feature/Http/Controllers/User/GiftControllerTest.php b/tests/Feature/Http/Controllers/User/GiftControllerTest.php new file mode 100644 index 000000000..afafb620b --- /dev/null +++ b/tests/Feature/Http/Controllers/User/GiftControllerTest.php @@ -0,0 +1,91 @@ +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)->get(route('users.gifts.create', [$user])); + + $response->assertOk(); + $response->assertViewIs('user.gift.create'); + $response->assertViewHas('user', $user); + $response->assertViewHas('bon'); + + // TODO: perform additional assertions +}); + +test('create 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(); + + // TODO: perform additional setup to trigger `abort_unless(403)`... + + $response = $this->actingAs($authUser)->get(route('users.gifts.create', [$user])); + + $response->assertForbidden(); +}); + +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(); + $bonTransactions = \App\Models\BonTransactions::factory()->times(3)->create(); + $authUser = \App\Models\User::factory()->create(); + + $response = $this->actingAs($authUser)->get(route('users.gifts.index', [$user])); + + $response->assertOk(); + $response->assertViewIs('user.gift.index'); + $response->assertViewHas('user', $user); + $response->assertViewHas('gifts'); + $response->assertViewHas('bon'); + $response->assertViewHas('sentGifts'); + $response->assertViewHas('receivedGifts'); + + // TODO: perform additional assertions +}); + +test('index 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(); + $bonTransactions = \App\Models\BonTransactions::factory()->times(3)->create(); + $authUser = \App\Models\User::factory()->create(); + + // TODO: perform additional setup to trigger `abort_unless(403)`... + + $response = $this->actingAs($authUser)->get(route('users.gifts.index', [$user])); + + $response->assertForbidden(); +}); + +test('store validates with a form request', function (): void { + $this->assertActionUsesFormRequest( + \App\Http\Controllers\User\GiftController::class, + 'store', + \App\Http\Requests\StoreGiftRequest::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(); + + $response = $this->actingAs($authUser)->post(route('users.gifts.store', [$user]), [ + // TODO: send request data + ]); + + $response->assertRedirect(withSuccess(trans('bon.gift-sent'))); + + // TODO: perform additional assertions +}); + +// test cases... diff --git a/tests/Feature/Http/Controllers/User/HistoryControllerTest.php b/tests/Feature/Http/Controllers/User/HistoryControllerTest.php new file mode 100644 index 000000000..a359e9e26 --- /dev/null +++ b/tests/Feature/Http/Controllers/User/HistoryControllerTest.php @@ -0,0 +1,34 @@ +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)->get(route('users.history.index', [$user])); + + $response->assertOk(); + $response->assertViewIs('user.history.index'); + $response->assertViewHas('user', $user); + $response->assertViewHas('history'); + + // TODO: perform additional assertions +}); + +test('index 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(); + + // TODO: perform additional setup to trigger `abort_unless(403)`... + + $response = $this->actingAs($authUser)->get(route('users.history.index', [$user])); + + $response->assertForbidden(); +}); + +// test cases... diff --git a/tests/Feature/Http/Controllers/User/InviteControllerTest.php b/tests/Feature/Http/Controllers/User/InviteControllerTest.php new file mode 100644 index 000000000..3f3f1d6f8 --- /dev/null +++ b/tests/Feature/Http/Controllers/User/InviteControllerTest.php @@ -0,0 +1,153 @@ +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)->get(route('users.invites.create', [$user])); + + $response->assertOk(); + $response->assertViewIs('user.invite.create'); + $response->assertViewHas('user', $user); + + // TODO: perform additional assertions +}); + +test('create 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(); + + // TODO: perform additional setup to trigger `abort_unless(403)`... + + $response = $this->actingAs($authUser)->get(route('users.invites.create', [$user])); + + $response->assertForbidden(); +}); + +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.'); + + $user = \App\Models\User::factory()->create(); + $invite = \App\Models\Invite::factory()->create(); + $authUser = \App\Models\User::factory()->create(); + + $response = $this->actingAs($authUser)->delete(route('users.invites.destroy', [$user, $invite])); + + $response->assertOk(); + $this->assertModelMissing($invite); + + // TODO: perform additional assertions +}); + +test('destroy aborts with a 403', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $user = \App\Models\User::factory()->create(); + $invite = \App\Models\Invite::factory()->create(); + $authUser = \App\Models\User::factory()->create(); + + // TODO: perform additional setup to trigger `abort_unless(403)`... + + $response = $this->actingAs($authUser)->delete(route('users.invites.destroy', [$user, $invite])); + + $response->assertForbidden(); +}); + +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(); + $authUser = \App\Models\User::factory()->create(); + + $response = $this->actingAs($authUser)->get(route('users.invites.index', [$user])); + + $response->assertOk(); + $response->assertViewIs('user.invite.index'); + $response->assertViewHas('user', $user); + $response->assertViewHas('invites'); + + // TODO: perform additional assertions +}); + +test('index 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(); + + // TODO: perform additional setup to trigger `abort_unless(403)`... + + $response = $this->actingAs($authUser)->get(route('users.invites.index', [$user])); + + $response->assertForbidden(); +}); + +test('send 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(); + $invite = \App\Models\Invite::factory()->create(); + $authUser = \App\Models\User::factory()->create(); + + $response = $this->actingAs($authUser)->post(route('users.invites.send', [$user, $invite]), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +test('send 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(); + $invite = \App\Models\Invite::factory()->create(); + $authUser = \App\Models\User::factory()->create(); + + // TODO: perform additional setup to trigger `abort_unless(403)`... + + $response = $this->actingAs($authUser)->post(route('users.invites.send', [$user, $invite]), [ + // TODO: send request data + ]); + + $response->assertForbidden(); +}); + +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('users.invites.store', [$user]), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +test('store aborts with a 403', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $user = \App\Models\User::factory()->create(); + $authUser = \App\Models\User::factory()->create(); + + // TODO: perform additional setup to trigger `abort_unless(403)`... + + $response = $this->actingAs($authUser)->post(route('users.invites.store', [$user]), [ + // TODO: send request data + ]); + + $response->assertForbidden(); +}); + +// test cases... diff --git a/tests/Feature/Http/Controllers/User/NotificationControllerTest.php b/tests/Feature/Http/Controllers/User/NotificationControllerTest.php new file mode 100644 index 000000000..010bcbc1e --- /dev/null +++ b/tests/Feature/Http/Controllers/User/NotificationControllerTest.php @@ -0,0 +1,177 @@ +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(); + $notification = \App\Models\Notification::factory()->create(); + $authUser = \App\Models\User::factory()->create(); + + $response = $this->actingAs($authUser)->delete(route('users.notifications.destroy', [$user, $notification])); + + $response->assertOk(); + $this->assertModelMissing($notification); + + // TODO: perform additional assertions +}); + +test('destroy aborts with a 403', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $user = \App\Models\User::factory()->create(); + $notification = \App\Models\Notification::factory()->create(); + $authUser = \App\Models\User::factory()->create(); + + // TODO: perform additional setup to trigger `abort_unless(403)`... + + $response = $this->actingAs($authUser)->delete(route('users.notifications.destroy', [$user, $notification])); + + $response->assertForbidden(); +}); + +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(); + $authUser = \App\Models\User::factory()->create(); + + $response = $this->actingAs($authUser)->get(route('users.notifications.index', [$user])); + + $response->assertOk(); + $response->assertViewIs('user.notification.index'); + + // TODO: perform additional assertions +}); + +test('index 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(); + + // TODO: perform additional setup to trigger `abort_unless(403)`... + + $response = $this->actingAs($authUser)->get(route('users.notifications.index', [$user])); + + $response->assertForbidden(); +}); + +test('mass 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.'); + + $user = \App\Models\User::factory()->create(); + $authUser = \App\Models\User::factory()->create(); + + $response = $this->actingAs($authUser)->delete(route('users.notifications.mass_destroy', [$user])); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +test('mass 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.'); + + $user = \App\Models\User::factory()->create(); + $authUser = \App\Models\User::factory()->create(); + + // TODO: perform additional setup to trigger `abort_unless(403)`... + + $response = $this->actingAs($authUser)->delete(route('users.notifications.mass_destroy', [$user])); + + $response->assertForbidden(); +}); + +test('mass 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.'); + + $user = \App\Models\User::factory()->create(); + $authUser = \App\Models\User::factory()->create(); + + $response = $this->actingAs($authUser)->patch(route('users.notifications.mass_update', [$user]), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +test('mass 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.'); + + $user = \App\Models\User::factory()->create(); + $authUser = \App\Models\User::factory()->create(); + + // TODO: perform additional setup to trigger `abort_unless(403)`... + + $response = $this->actingAs($authUser)->patch(route('users.notifications.mass_update', [$user]), [ + // TODO: send request data + ]); + + $response->assertForbidden(); +}); + +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 = \App\Models\User::factory()->create(); + $notification = \App\Models\Notification::factory()->create(); + $authUser = \App\Models\User::factory()->create(); + + $response = $this->actingAs($authUser)->get(route('users.notifications.show', [$user, $notification])); + + $response->assertRedirect(withSuccess(trans('notification.marked-read'))); + + // TODO: perform additional assertions +}); + +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.'); + + $user = \App\Models\User::factory()->create(); + $notification = \App\Models\Notification::factory()->create(); + $authUser = \App\Models\User::factory()->create(); + + // TODO: perform additional setup to trigger `abort_unless(403)`... + + $response = $this->actingAs($authUser)->get(route('users.notifications.show', [$user, $notification])); + + $response->assertForbidden(); +}); + +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.'); + + $user = \App\Models\User::factory()->create(); + $notification = \App\Models\Notification::factory()->create(); + $authUser = \App\Models\User::factory()->create(); + + $response = $this->actingAs($authUser)->patch(route('users.notifications.update', [$user, $notification]), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // 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.'); + + $user = \App\Models\User::factory()->create(); + $notification = \App\Models\Notification::factory()->create(); + $authUser = \App\Models\User::factory()->create(); + + // TODO: perform additional setup to trigger `abort_unless(403)`... + + $response = $this->actingAs($authUser)->patch(route('users.notifications.update', [$user, $notification]), [ + // TODO: send request data + ]); + + $response->assertForbidden(); +}); + +// test cases... diff --git a/tests/Feature/Http/Controllers/User/NotificationSettingControllerTest.php b/tests/Feature/Http/Controllers/User/NotificationSettingControllerTest.php new file mode 100644 index 000000000..cdfeae6a1 --- /dev/null +++ b/tests/Feature/Http/Controllers/User/NotificationSettingControllerTest.php @@ -0,0 +1,66 @@ +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(); + $groups = \App\Models\Group::factory()->times(3)->create(); + $authUser = \App\Models\User::factory()->create(); + + $response = $this->actingAs($authUser)->get(route('users.notification_settings.edit', [$user])); + + $response->assertOk(); + $response->assertViewIs('user.notification_setting.edit'); + $response->assertViewHas('user', $user); + $response->assertViewHas('groups', $groups); + + // TODO: perform additional assertions +}); + +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.'); + + $user = \App\Models\User::factory()->create(); + $groups = \App\Models\Group::factory()->times(3)->create(); + $authUser = \App\Models\User::factory()->create(); + + // TODO: perform additional setup to trigger `abort_unless(403)`... + + $response = $this->actingAs($authUser)->get(route('users.notification_settings.edit', [$user])); + + $response->assertForbidden(); +}); + +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.'); + + $user = \App\Models\User::factory()->create(); + $authUser = \App\Models\User::factory()->create(); + + $response = $this->actingAs($authUser)->patch(route('users.notification_settings.update', [$user]), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // 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.'); + + $user = \App\Models\User::factory()->create(); + $authUser = \App\Models\User::factory()->create(); + + // TODO: perform additional setup to trigger `abort_unless(403)`... + + $response = $this->actingAs($authUser)->patch(route('users.notification_settings.update', [$user]), [ + // TODO: send request data + ]); + + $response->assertForbidden(); +}); + +// test cases... diff --git a/tests/Feature/Http/Controllers/User/PasskeyControllerTest.php b/tests/Feature/Http/Controllers/User/PasskeyControllerTest.php new file mode 100644 index 000000000..f4bcf8a35 --- /dev/null +++ b/tests/Feature/Http/Controllers/User/PasskeyControllerTest.php @@ -0,0 +1,33 @@ +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)->get(route('users.passkey.edit', [$user])); + + $response->assertOk(); + $response->assertViewIs('user.passkey.edit'); + $response->assertViewHas('user', $user); + + // TODO: perform additional assertions +}); + +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.'); + + $user = \App\Models\User::factory()->create(); + $authUser = \App\Models\User::factory()->create(); + + // TODO: perform additional setup to trigger `abort_unless(403)`... + + $response = $this->actingAs($authUser)->get(route('users.passkey.edit', [$user])); + + $response->assertForbidden(); +}); + +// test cases... diff --git a/tests/Feature/Http/Controllers/User/PasswordControllerTest.php b/tests/Feature/Http/Controllers/User/PasswordControllerTest.php new file mode 100644 index 000000000..a32b8b407 --- /dev/null +++ b/tests/Feature/Http/Controllers/User/PasswordControllerTest.php @@ -0,0 +1,33 @@ +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)->get(route('users.password.edit', [$user])); + + $response->assertOk(); + $response->assertViewIs('user.password.edit'); + $response->assertViewHas('user', $user); + + // TODO: perform additional assertions +}); + +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.'); + + $user = \App\Models\User::factory()->create(); + $authUser = \App\Models\User::factory()->create(); + + // TODO: perform additional setup to trigger `abort_unless(403)`... + + $response = $this->actingAs($authUser)->get(route('users.password.edit', [$user])); + + $response->assertForbidden(); +}); + +// test cases... diff --git a/tests/Feature/Http/Controllers/User/PeerControllerTest.php b/tests/Feature/Http/Controllers/User/PeerControllerTest.php new file mode 100644 index 000000000..7b6d0bd3e --- /dev/null +++ b/tests/Feature/Http/Controllers/User/PeerControllerTest.php @@ -0,0 +1,60 @@ +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)->get(route('users.peers.index', [$user])); + + $response->assertOk(); + $response->assertViewIs('user.peer.index'); + $response->assertViewHas('user', $user); + $response->assertViewHas('history'); + + // TODO: perform additional assertions +}); + +test('index 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(); + + // TODO: perform additional setup to trigger `abort_unless(403)`... + + $response = $this->actingAs($authUser)->get(route('users.peers.index', [$user])); + + $response->assertForbidden(); +}); + +test('mass 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.'); + + $user = \App\Models\User::factory()->create(); + $authUser = \App\Models\User::factory()->create(); + + $response = $this->actingAs($authUser)->delete(route('users.peers.mass_destroy', [$user])); + + $response->assertRedirect(withErrors('You can only flush twice a day!')); + + // TODO: perform additional assertions +}); + +test('mass 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.'); + + $user = \App\Models\User::factory()->create(); + $authUser = \App\Models\User::factory()->create(); + + // TODO: perform additional setup to trigger `abort_unless(403)`... + + $response = $this->actingAs($authUser)->delete(route('users.peers.mass_destroy', [$user])); + + $response->assertForbidden(); +}); + +// test cases... diff --git a/tests/Feature/Http/Controllers/User/PostControllerTest.php b/tests/Feature/Http/Controllers/User/PostControllerTest.php new file mode 100644 index 000000000..24e3b3b97 --- /dev/null +++ b/tests/Feature/Http/Controllers/User/PostControllerTest.php @@ -0,0 +1,22 @@ +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(); + $topics = \App\Models\Topic::factory()->times(3)->create(); + $authUser = \App\Models\User::factory()->create(); + + $response = $this->actingAs($authUser)->get(route('users.posts.index', [$user])); + + $response->assertOk(); + $response->assertViewIs('user.post.index'); + $response->assertViewHas('user', $user); + $response->assertViewHas('posts'); + + // TODO: perform additional assertions +}); + +// test cases... diff --git a/tests/Feature/Http/Controllers/User/PrivacySettingControllerTest.php b/tests/Feature/Http/Controllers/User/PrivacySettingControllerTest.php new file mode 100644 index 000000000..6f71a73b2 --- /dev/null +++ b/tests/Feature/Http/Controllers/User/PrivacySettingControllerTest.php @@ -0,0 +1,66 @@ +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(); + $groups = \App\Models\Group::factory()->times(3)->create(); + $authUser = \App\Models\User::factory()->create(); + + $response = $this->actingAs($authUser)->get(route('users.privacy_settings.edit', [$user])); + + $response->assertOk(); + $response->assertViewIs('user.privacy_setting.edit'); + $response->assertViewHas('user', $user); + $response->assertViewHas('groups', $groups); + + // TODO: perform additional assertions +}); + +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.'); + + $user = \App\Models\User::factory()->create(); + $groups = \App\Models\Group::factory()->times(3)->create(); + $authUser = \App\Models\User::factory()->create(); + + // TODO: perform additional setup to trigger `abort_unless(403)`... + + $response = $this->actingAs($authUser)->get(route('users.privacy_settings.edit', [$user])); + + $response->assertForbidden(); +}); + +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.'); + + $user = \App\Models\User::factory()->create(); + $authUser = \App\Models\User::factory()->create(); + + $response = $this->actingAs($authUser)->patch(route('users.privacy_settings.update', [$user]), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // 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.'); + + $user = \App\Models\User::factory()->create(); + $authUser = \App\Models\User::factory()->create(); + + // TODO: perform additional setup to trigger `abort_unless(403)`... + + $response = $this->actingAs($authUser)->patch(route('users.privacy_settings.update', [$user]), [ + // TODO: send request data + ]); + + $response->assertForbidden(); +}); + +// test cases... diff --git a/tests/Feature/Http/Controllers/User/ReceivedPrivateMessageControllerTest.php b/tests/Feature/Http/Controllers/User/ReceivedPrivateMessageControllerTest.php new file mode 100644 index 000000000..b2398a61e --- /dev/null +++ b/tests/Feature/Http/Controllers/User/ReceivedPrivateMessageControllerTest.php @@ -0,0 +1,183 @@ +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(); + $privateMessage = \App\Models\PrivateMessage::factory()->create(); + $authUser = \App\Models\User::factory()->create(); + + $response = $this->actingAs($authUser)->delete(route('users.received_messages.destroy', [$user, 'receivedPrivateMessage' => $receivedPrivateMessage])); + + $response->assertOk(); + $this->assertModelMissing($receivedPrivateMessage); + + // TODO: perform additional assertions +}); + +test('destroy aborts with a 403', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $user = \App\Models\User::factory()->create(); + $privateMessage = \App\Models\PrivateMessage::factory()->create(); + $authUser = \App\Models\User::factory()->create(); + + // TODO: perform additional setup to trigger `abort_unless(403)`... + + $response = $this->actingAs($authUser)->delete(route('users.received_messages.destroy', [$user, 'receivedPrivateMessage' => $receivedPrivateMessage])); + + $response->assertForbidden(); +}); + +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(); + $authUser = \App\Models\User::factory()->create(); + + $response = $this->actingAs($authUser)->get(route('users.received_messages.index', [$user])); + + $response->assertOk(); + $response->assertViewIs('user.received-private-message.index'); + $response->assertViewHas('user', $user); + $response->assertViewHas('pms'); + $response->assertViewHas('subject'); + + // TODO: perform additional assertions +}); + +test('index 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(); + + // TODO: perform additional setup to trigger `abort_unless(403)`... + + $response = $this->actingAs($authUser)->get(route('users.received_messages.index', [$user])); + + $response->assertForbidden(); +}); + +test('mass 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.'); + + $user = \App\Models\User::factory()->create(); + $authUser = \App\Models\User::factory()->create(); + + $response = $this->actingAs($authUser)->delete(route('users.received_messages.mass_destroy', [$user])); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +test('mass 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.'); + + $user = \App\Models\User::factory()->create(); + $authUser = \App\Models\User::factory()->create(); + + // TODO: perform additional setup to trigger `abort_unless(403)`... + + $response = $this->actingAs($authUser)->delete(route('users.received_messages.mass_destroy', [$user])); + + $response->assertForbidden(); +}); + +test('mass 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.'); + + $user = \App\Models\User::factory()->create(); + $authUser = \App\Models\User::factory()->create(); + + $response = $this->actingAs($authUser)->post(route('users.received_messages.mass_update', [$user]), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +test('mass 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.'); + + $user = \App\Models\User::factory()->create(); + $authUser = \App\Models\User::factory()->create(); + + // TODO: perform additional setup to trigger `abort_unless(403)`... + + $response = $this->actingAs($authUser)->post(route('users.received_messages.mass_update', [$user]), [ + // TODO: send request data + ]); + + $response->assertForbidden(); +}); + +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 = \App\Models\User::factory()->create(); + $privateMessage = \App\Models\PrivateMessage::factory()->create(); + $authUser = \App\Models\User::factory()->create(); + + $response = $this->actingAs($authUser)->get(route('users.received_messages.show', [$user, 'receivedPrivateMessage' => $receivedPrivateMessage])); + + $response->assertOk(); + $response->assertViewIs('user.received-private-message.show'); + $response->assertViewHas('pm'); + $response->assertViewHas('user', $user); + + // TODO: perform additional assertions +}); + +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.'); + + $user = \App\Models\User::factory()->create(); + $privateMessage = \App\Models\PrivateMessage::factory()->create(); + $authUser = \App\Models\User::factory()->create(); + + // TODO: perform additional setup to trigger `abort_unless(403)`... + + $response = $this->actingAs($authUser)->get(route('users.received_messages.show', [$user, 'receivedPrivateMessage' => $receivedPrivateMessage])); + + $response->assertForbidden(); +}); + +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.'); + + $user = \App\Models\User::factory()->create(); + $privateMessage = \App\Models\PrivateMessage::factory()->create(); + $authUser = \App\Models\User::factory()->create(); + + $response = $this->actingAs($authUser)->patch(route('users.received_messages.update', [$user, 'receivedPrivateMessage' => $receivedPrivateMessage]), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // 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.'); + + $user = \App\Models\User::factory()->create(); + $privateMessage = \App\Models\PrivateMessage::factory()->create(); + $authUser = \App\Models\User::factory()->create(); + + // TODO: perform additional setup to trigger `abort_unless(403)`... + + $response = $this->actingAs($authUser)->patch(route('users.received_messages.update', [$user, 'receivedPrivateMessage' => $receivedPrivateMessage]), [ + // TODO: send request data + ]); + + $response->assertForbidden(); +}); + +// test cases... diff --git a/tests/Feature/Http/Controllers/User/ResurrectionControllerTest.php b/tests/Feature/Http/Controllers/User/ResurrectionControllerTest.php new file mode 100644 index 000000000..bbac94480 --- /dev/null +++ b/tests/Feature/Http/Controllers/User/ResurrectionControllerTest.php @@ -0,0 +1,94 @@ +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(); + $graveyard = \App\Models\Graveyard::factory()->create(); + $authUser = \App\Models\User::factory()->create(); + + $response = $this->actingAs($authUser)->delete(route('users.resurrections.destroy', [$user, 'resurrection' => $resurrection])); + + $response->assertOk(); + $this->assertModelMissing($resurrection); + + // TODO: perform additional assertions +}); + +test('destroy aborts with a 403', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $user = \App\Models\User::factory()->create(); + $graveyard = \App\Models\Graveyard::factory()->create(); + $authUser = \App\Models\User::factory()->create(); + + // TODO: perform additional setup to trigger `abort_unless(403)`... + + $response = $this->actingAs($authUser)->delete(route('users.resurrections.destroy', [$user, 'resurrection' => $resurrection])); + + $response->assertForbidden(); +}); + +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(); + $authUser = \App\Models\User::factory()->create(); + + $response = $this->actingAs($authUser)->get(route('users.resurrections.index', [$user])); + + $response->assertOk(); + $response->assertViewIs('user.resurrection.index'); + $response->assertViewHas('user', $user); + + // TODO: perform additional assertions +}); + +test('index 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(); + + // TODO: perform additional setup to trigger `abort_unless(403)`... + + $response = $this->actingAs($authUser)->get(route('users.resurrections.index', [$user])); + + $response->assertForbidden(); +}); + +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(); + $torrent = \App\Models\Torrent::factory()->create(); + $authUser = \App\Models\User::factory()->create(); + + $response = $this->actingAs($authUser)->post(route('users.resurrections.store', [$user]), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +test('store aborts with a 403', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $user = \App\Models\User::factory()->create(); + $torrent = \App\Models\Torrent::factory()->create(); + $authUser = \App\Models\User::factory()->create(); + + // TODO: perform additional setup to trigger `abort_unless(403)`... + + $response = $this->actingAs($authUser)->post(route('users.resurrections.store', [$user]), [ + // TODO: send request data + ]); + + $response->assertForbidden(); +}); + +// test cases... diff --git a/tests/Feature/Http/Controllers/User/RsskeyControllerTest.php b/tests/Feature/Http/Controllers/User/RsskeyControllerTest.php new file mode 100644 index 000000000..d015b14b4 --- /dev/null +++ b/tests/Feature/Http/Controllers/User/RsskeyControllerTest.php @@ -0,0 +1,33 @@ +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)->get(route('users.rsskey.edit', [$user])); + + $response->assertOk(); + $response->assertViewIs('user.rsskey.edit'); + $response->assertViewHas('user', $user); + + // TODO: perform additional assertions +}); + +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.'); + + $user = \App\Models\User::factory()->create(); + $authUser = \App\Models\User::factory()->create(); + + // TODO: perform additional setup to trigger `abort_unless(403)`... + + $response = $this->actingAs($authUser)->get(route('users.rsskey.edit', [$user])); + + $response->assertForbidden(); +}); + +// test cases... diff --git a/tests/Feature/Http/Controllers/User/SeedboxControllerTest.php b/tests/Feature/Http/Controllers/User/SeedboxControllerTest.php new file mode 100644 index 000000000..9884e77db --- /dev/null +++ b/tests/Feature/Http/Controllers/User/SeedboxControllerTest.php @@ -0,0 +1,34 @@ +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)->get(route('users.seedboxes.index', [$user])); + + $response->assertOk(); + $response->assertViewIs('user.seedbox.index'); + $response->assertViewHas('user', $user); + $response->assertViewHas('seedboxes'); + + // TODO: perform additional assertions +}); + +test('index 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(); + + // TODO: perform additional setup to trigger `abort_unless(403)`... + + $response = $this->actingAs($authUser)->get(route('users.seedboxes.index', [$user])); + + $response->assertForbidden(); +}); + +// test cases... diff --git a/tests/Feature/Http/Controllers/User/SentPrivateMessageControllerTest.php b/tests/Feature/Http/Controllers/User/SentPrivateMessageControllerTest.php new file mode 100644 index 000000000..57411be2c --- /dev/null +++ b/tests/Feature/Http/Controllers/User/SentPrivateMessageControllerTest.php @@ -0,0 +1,157 @@ +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)->get(route('users.sent_messages.create', [$user])); + + $response->assertOk(); + $response->assertViewIs('user.sent-private-message.create'); + $response->assertViewHas('user', $user); + $response->assertViewHas('username'); + + // TODO: perform additional assertions +}); + +test('create 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(); + + // TODO: perform additional setup to trigger `abort_unless(403)`... + + $response = $this->actingAs($authUser)->get(route('users.sent_messages.create', [$user])); + + $response->assertForbidden(); +}); + +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(); + $authUser = \App\Models\User::factory()->create(); + + $response = $this->actingAs($authUser)->get(route('users.sent_messages.index', [$user])); + + $response->assertOk(); + $response->assertViewIs('user.sent-private-message.index'); + $response->assertViewHas('user', $user); + $response->assertViewHas('pms'); + $response->assertViewHas('subject'); + + // TODO: perform additional assertions +}); + +test('index 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(); + + // TODO: perform additional setup to trigger `abort_unless(403)`... + + $response = $this->actingAs($authUser)->get(route('users.sent_messages.index', [$user])); + + $response->assertForbidden(); +}); + +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 = \App\Models\User::factory()->create(); + $privateMessage = \App\Models\PrivateMessage::factory()->create(); + $authUser = \App\Models\User::factory()->create(); + + $response = $this->actingAs($authUser)->get(route('users.sent_messages.show', [$user, 'sentPrivateMessage' => $sentPrivateMessage])); + + $response->assertOk(); + $response->assertViewIs('user.sent-private-message.show'); + $response->assertViewHas('privateMessage', $privateMessage); + $response->assertViewHas('user', $user); + + // TODO: perform additional assertions +}); + +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.'); + + $user = \App\Models\User::factory()->create(); + $privateMessage = \App\Models\PrivateMessage::factory()->create(); + $authUser = \App\Models\User::factory()->create(); + + // TODO: perform additional setup to trigger `abort_unless(403)`... + + $response = $this->actingAs($authUser)->get(route('users.sent_messages.show', [$user, 'sentPrivateMessage' => $sentPrivateMessage])); + + $response->assertForbidden(); +}); + +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('users.sent_messages.store', [$user]), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +test('store aborts with a 403', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $user = \App\Models\User::factory()->create(); + $authUser = \App\Models\User::factory()->create(); + + // TODO: perform additional setup to trigger `abort_unless(403)`... + + $response = $this->actingAs($authUser)->post(route('users.sent_messages.store', [$user]), [ + // TODO: send request data + ]); + + $response->assertForbidden(); +}); + +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.'); + + $user = \App\Models\User::factory()->create(); + $privateMessage = \App\Models\PrivateMessage::factory()->create(); + $authUser = \App\Models\User::factory()->create(); + + $response = $this->actingAs($authUser)->patch(route('users.sent_messages.update', [$user, 'sentPrivateMessage' => $sentPrivateMessage]), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // 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.'); + + $user = \App\Models\User::factory()->create(); + $privateMessage = \App\Models\PrivateMessage::factory()->create(); + $authUser = \App\Models\User::factory()->create(); + + // TODO: perform additional setup to trigger `abort_unless(403)`... + + $response = $this->actingAs($authUser)->patch(route('users.sent_messages.update', [$user, 'sentPrivateMessage' => $sentPrivateMessage]), [ + // TODO: send request data + ]); + + $response->assertForbidden(); +}); + +// test cases... diff --git a/tests/Feature/Http/Controllers/User/TipControllerTest.php b/tests/Feature/Http/Controllers/User/TipControllerTest.php new file mode 100644 index 000000000..b0ec539c9 --- /dev/null +++ b/tests/Feature/Http/Controllers/User/TipControllerTest.php @@ -0,0 +1,81 @@ +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(); + $bonTransactions = \App\Models\BonTransactions::factory()->times(3)->create(); + $authUser = \App\Models\User::factory()->create(); + + $response = $this->actingAs($authUser)->get(route('users.tips.index', [$user])); + + $response->assertOk(); + $response->assertViewIs('user.tip.index'); + $response->assertViewHas('user', $user); + $response->assertViewHas('tips'); + $response->assertViewHas('bon'); + $response->assertViewHas('sentTips'); + $response->assertViewHas('receivedTips'); + + // TODO: perform additional assertions +}); + +test('index 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(); + $bonTransactions = \App\Models\BonTransactions::factory()->times(3)->create(); + $authUser = \App\Models\User::factory()->create(); + + // TODO: perform additional setup to trigger `abort_unless(403)`... + + $response = $this->actingAs($authUser)->get(route('users.tips.index', [$user])); + + $response->assertForbidden(); +}); + +test('store validates with a form request', function (): void { + $this->assertActionUsesFormRequest( + \App\Http\Controllers\User\TipController::class, + 'store', + \App\Http\Requests\StoreTipRequest::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(); + $torrent = \App\Models\Torrent::factory()->create(); + $post = \App\Models\Post::factory()->create(); + $authUser = \App\Models\User::factory()->create(); + + $response = $this->actingAs($authUser)->post(route('users.tips.store', [$user]), [ + // TODO: send request data + ]); + + $response->assertRedirect(withSuccess(trans('bon.success-tip'))); + + // TODO: perform additional assertions +}); + +test('store aborts with a 403', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $user = \App\Models\User::factory()->create(); + $torrent = \App\Models\Torrent::factory()->create(); + $post = \App\Models\Post::factory()->create(); + $authUser = \App\Models\User::factory()->create(); + + // TODO: perform additional setup to trigger `abort_unless(403)`... + + $response = $this->actingAs($authUser)->post(route('users.tips.store', [$user]), [ + // TODO: send request data + ]); + + $response->assertForbidden(); +}); + +// test cases... diff --git a/tests/Feature/Http/Controllers/User/TopicControllerTest.php b/tests/Feature/Http/Controllers/User/TopicControllerTest.php new file mode 100644 index 000000000..c29a66b17 --- /dev/null +++ b/tests/Feature/Http/Controllers/User/TopicControllerTest.php @@ -0,0 +1,21 @@ +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)->get(route('users.topics.index', [$user])); + + $response->assertOk(); + $response->assertViewIs('user.topic.index'); + $response->assertViewHas('user', $user); + $response->assertViewHas('topics'); + + // TODO: perform additional assertions +}); + +// test cases... diff --git a/tests/Feature/Http/Controllers/User/TorrentControllerTest.php b/tests/Feature/Http/Controllers/User/TorrentControllerTest.php new file mode 100644 index 000000000..8e72ec61d --- /dev/null +++ b/tests/Feature/Http/Controllers/User/TorrentControllerTest.php @@ -0,0 +1,34 @@ +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)->get(route('users.torrents.index', [$user])); + + $response->assertOk(); + $response->assertViewIs('user.torrent.index'); + $response->assertViewHas('user', $user); + $response->assertViewHas('history'); + + // TODO: perform additional assertions +}); + +test('index 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(); + + // TODO: perform additional setup to trigger `abort_unless(403)`... + + $response = $this->actingAs($authUser)->get(route('users.torrents.index', [$user])); + + $response->assertForbidden(); +}); + +// test cases... diff --git a/tests/Feature/Http/Controllers/User/TorrentZipControllerTest.php b/tests/Feature/Http/Controllers/User/TorrentZipControllerTest.php new file mode 100644 index 000000000..134f2ea98 --- /dev/null +++ b/tests/Feature/Http/Controllers/User/TorrentZipControllerTest.php @@ -0,0 +1,33 @@ +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(); + $torrents = \App\Models\Torrent::factory()->times(3)->create(); + $authUser = \App\Models\User::factory()->create(); + + $response = $this->actingAs($authUser)->get(route('users.torrent_zip.show', [$user])); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +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.'); + + $user = \App\Models\User::factory()->create(); + $torrents = \App\Models\Torrent::factory()->times(3)->create(); + $authUser = \App\Models\User::factory()->create(); + + // TODO: perform additional setup to trigger `abort_unless(403)`... + + $response = $this->actingAs($authUser)->get(route('users.torrent_zip.show', [$user])); + + $response->assertForbidden(); +}); + +// test cases... diff --git a/tests/Feature/Http/Controllers/User/TransactionControllerTest.php b/tests/Feature/Http/Controllers/User/TransactionControllerTest.php new file mode 100644 index 000000000..90aa5b512 --- /dev/null +++ b/tests/Feature/Http/Controllers/User/TransactionControllerTest.php @@ -0,0 +1,78 @@ +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(); + $bonExchanges = \App\Models\BonExchange::factory()->times(3)->create(); + $authUser = \App\Models\User::factory()->create(); + + $response = $this->actingAs($authUser)->get(route('users.transactions.create', [$user])); + + $response->assertOk(); + $response->assertViewIs('user.transaction.create'); + $response->assertViewHas('user', $user); + $response->assertViewHas('bon'); + $response->assertViewHas('activefl'); + $response->assertViewHas('items'); + + // TODO: perform additional assertions +}); + +test('create 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(); + $bonExchanges = \App\Models\BonExchange::factory()->times(3)->create(); + $authUser = \App\Models\User::factory()->create(); + + // TODO: perform additional setup to trigger `abort_unless(403)`... + + $response = $this->actingAs($authUser)->get(route('users.transactions.create', [$user])); + + $response->assertForbidden(); +}); + +test('store validates with a form request', function (): void { + $this->assertActionUsesFormRequest( + \App\Http\Controllers\User\TransactionController::class, + 'store', + \App\Http\Requests\StoreTransactionRequest::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(); + $bonExchange = \App\Models\BonExchange::factory()->create(); + $authUser = \App\Models\User::factory()->create(); + + $response = $this->actingAs($authUser)->post(route('users.transactions.store', [$user]), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +test('store aborts with a 403', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $user = \App\Models\User::factory()->create(); + $bonExchange = \App\Models\BonExchange::factory()->create(); + $authUser = \App\Models\User::factory()->create(); + + // TODO: perform additional setup to trigger `abort_unless(403)`... + + $response = $this->actingAs($authUser)->post(route('users.transactions.store', [$user]), [ + // TODO: send request data + ]); + + $response->assertForbidden(); +}); + +// test cases... diff --git a/tests/Feature/Http/Controllers/User/TwoStepControllerTest.php b/tests/Feature/Http/Controllers/User/TwoStepControllerTest.php new file mode 100644 index 000000000..156d67e95 --- /dev/null +++ b/tests/Feature/Http/Controllers/User/TwoStepControllerTest.php @@ -0,0 +1,33 @@ +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)->get(route('users.two_step.edit', [$user])); + + $response->assertOk(); + $response->assertViewIs('user.two_step.edit'); + $response->assertViewHas('user', $user); + + // TODO: perform additional assertions +}); + +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.'); + + $user = \App\Models\User::factory()->create(); + $authUser = \App\Models\User::factory()->create(); + + // TODO: perform additional setup to trigger `abort_unless(403)`... + + $response = $this->actingAs($authUser)->get(route('users.two_step.edit', [$user])); + + $response->assertForbidden(); +}); + +// test cases... diff --git a/tests/Feature/Http/Controllers/User/UserControllerTest.php b/tests/Feature/Http/Controllers/User/UserControllerTest.php new file mode 100644 index 000000000..38c57a120 --- /dev/null +++ b/tests/Feature/Http/Controllers/User/UserControllerTest.php @@ -0,0 +1,121 @@ +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('users.accept.rules', [$user]), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +test('accept rules 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(); + + // TODO: perform additional setup to trigger `abort_unless(403)`... + + $response = $this->actingAs($authUser)->post(route('users.accept.rules', [$user]), [ + // TODO: send request data + ]); + + $response->assertForbidden(); +}); + +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.'); + + $user = \App\Models\User::factory()->create(); + $authUser = \App\Models\User::factory()->create(); + + $response = $this->actingAs($authUser)->get(route('users.edit', [$user])); + + $response->assertOk(); + $response->assertViewIs('user.profile.edit'); + $response->assertViewHas('user', $user); + + // TODO: perform additional assertions +}); + +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.'); + + $user = \App\Models\User::factory()->create(); + $authUser = \App\Models\User::factory()->create(); + + // TODO: perform additional setup to trigger `abort_unless(403)`... + + $response = $this->actingAs($authUser)->get(route('users.edit', [$user])); + + $response->assertForbidden(); +}); + +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 = \App\Models\User::factory()->create(); + $invite = \App\Models\Invite::factory()->create(); + $peer = \App\Models\Peer::factory()->create(); + $authUser = \App\Models\User::factory()->create(); + + $response = $this->actingAs($authUser)->get(route('users.show', [$user])); + + $response->assertOk(); + $response->assertViewIs('user.profile.show'); + $response->assertViewHas('user', $user); + $response->assertViewHas('followers'); + $response->assertViewHas('history'); + $response->assertViewHas('manualWarnings'); + $response->assertViewHas('autoWarnings'); + $response->assertViewHas('softDeletedWarnings'); + $response->assertViewHas('boughtUpload'); + $response->assertViewHas('invitedBy'); + $response->assertViewHas('clients'); + $response->assertViewHas('achievements'); + $response->assertViewHas('peers'); + $response->assertViewHas('watch'); + + // TODO: perform additional assertions +}); + +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.'); + + $user = \App\Models\User::factory()->create(); + $authUser = \App\Models\User::factory()->create(); + + $response = $this->actingAs($authUser)->patch(route('users.update', [$user]), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // 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.'); + + $user = \App\Models\User::factory()->create(); + $authUser = \App\Models\User::factory()->create(); + + // TODO: perform additional setup to trigger `abort_unless(403)`... + + $response = $this->actingAs($authUser)->patch(route('users.update', [$user]), [ + // TODO: send request data + ]); + + $response->assertForbidden(); +}); + +// test cases... diff --git a/tests/Feature/Http/Controllers/User/WarningControllerTest.php b/tests/Feature/Http/Controllers/User/WarningControllerTest.php new file mode 100644 index 000000000..26a313b15 --- /dev/null +++ b/tests/Feature/Http/Controllers/User/WarningControllerTest.php @@ -0,0 +1,92 @@ +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(); + $warning = \App\Models\Warning::factory()->create(); + $authUser = \App\Models\User::factory()->create(); + + $response = $this->actingAs($authUser)->delete(route('users.warnings.destroy', [$user, $warning])); + + $response->assertOk(); + $this->assertModelMissing($warning); + + // TODO: perform additional assertions +}); + +test('destroy aborts with a 403', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $user = \App\Models\User::factory()->create(); + $warning = \App\Models\Warning::factory()->create(); + $authUser = \App\Models\User::factory()->create(); + + // TODO: perform additional setup to trigger `abort_unless(403)`... + + $response = $this->actingAs($authUser)->delete(route('users.warnings.destroy', [$user, $warning])); + + $response->assertForbidden(); +}); + +test('mass 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.'); + + $user = \App\Models\User::factory()->create(); + $authUser = \App\Models\User::factory()->create(); + + $response = $this->actingAs($authUser)->delete(route('users.warnings.mass_destroy', [$user])); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +test('mass 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.'); + + $user = \App\Models\User::factory()->create(); + $authUser = \App\Models\User::factory()->create(); + + // TODO: perform additional setup to trigger `abort_unless(403)`... + + $response = $this->actingAs($authUser)->delete(route('users.warnings.mass_destroy', [$user])); + + $response->assertForbidden(); +}); + +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.'); + + $user = \App\Models\User::factory()->create(); + $warning = \App\Models\Warning::factory()->create(); + $authUser = \App\Models\User::factory()->create(); + + $response = $this->actingAs($authUser)->patch(route('users.warnings.update', [$user, $warning]), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // 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.'); + + $user = \App\Models\User::factory()->create(); + $warning = \App\Models\Warning::factory()->create(); + $authUser = \App\Models\User::factory()->create(); + + // TODO: perform additional setup to trigger `abort_unless(403)`... + + $response = $this->actingAs($authUser)->patch(route('users.warnings.update', [$user, $warning]), [ + // TODO: send request data + ]); + + $response->assertForbidden(); +}); + +// test cases... diff --git a/tests/Feature/Http/Controllers/User/WishControllerTest.php b/tests/Feature/Http/Controllers/User/WishControllerTest.php new file mode 100644 index 000000000..fbcb2f13d --- /dev/null +++ b/tests/Feature/Http/Controllers/User/WishControllerTest.php @@ -0,0 +1,98 @@ +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(); + $wish = \App\Models\Wish::factory()->create(); + $authUser = \App\Models\User::factory()->create(); + + $response = $this->actingAs($authUser)->delete(route('users.wishes.destroy', [$user, $wish])); + + $response->assertOk(); + $this->assertModelMissing($wish); + + // TODO: perform additional assertions +}); + +test('destroy aborts with a 403', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $user = \App\Models\User::factory()->create(); + $wish = \App\Models\Wish::factory()->create(); + $authUser = \App\Models\User::factory()->create(); + + // TODO: perform additional setup to trigger `abort_unless(403)`... + + $response = $this->actingAs($authUser)->delete(route('users.wishes.destroy', [$user, $wish])); + + $response->assertForbidden(); +}); + +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(); + $authUser = \App\Models\User::factory()->create(); + + $response = $this->actingAs($authUser)->get(route('users.wishes.index', [$user])); + + $response->assertOk(); + $response->assertViewIs('user.wish.index'); + $response->assertViewHas('user', $user); + $response->assertViewHas('wishes'); + $response->assertViewHas('route'); + + // TODO: perform additional assertions +}); + +test('index 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(); + + // TODO: perform additional setup to trigger `abort_unless(403)`... + + $response = $this->actingAs($authUser)->get(route('users.wishes.index', [$user])); + + $response->assertForbidden(); +}); + +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(); + $torrent = \App\Models\Torrent::factory()->create(); + $wish = \App\Models\Wish::factory()->create(); + $authUser = \App\Models\User::factory()->create(); + + $response = $this->actingAs($authUser)->post(route('users.wishes.store', [$user]), [ + // TODO: send request data + ]); + + $response->assertOk(); + + // TODO: perform additional assertions +}); + +test('store aborts with a 403', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $user = \App\Models\User::factory()->create(); + $torrent = \App\Models\Torrent::factory()->create(); + $wish = \App\Models\Wish::factory()->create(); + $authUser = \App\Models\User::factory()->create(); + + // TODO: perform additional setup to trigger `abort_unless(403)`... + + $response = $this->actingAs($authUser)->post(route('users.wishes.store', [$user]), [ + // TODO: send request data + ]); + + $response->assertForbidden(); +}); + +// test cases... diff --git a/tests/Feature/Http/Livewire/LaravelLogViewerTest.php b/tests/Feature/Http/Livewire/LaravelLogViewerTest.php new file mode 100644 index 000000000..2322c5233 --- /dev/null +++ b/tests/Feature/Http/Livewire/LaravelLogViewerTest.php @@ -0,0 +1,3 @@ +subject = new \App\Http\Requests\MassUpsertPlaylistTorrentRequest(); +}); + +test('authorize', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->authorize(); + + $this->assertTrue($actual); +}); + +test('rules', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->rules(); + + $this->assertValidationRules([ + 'playlist_id' => [ + 'required', + 'numeric', + 'integer', + ], + 'torrent_urls' => [ + 'required', + 'max:65535', + ], + ], $actual); +}); + +// test cases... diff --git a/tests/Unit/Http/Requests/Staff/ApproveApplicationRequestTest.php b/tests/Unit/Http/Requests/Staff/ApproveApplicationRequestTest.php new file mode 100644 index 000000000..ce5a02e71 --- /dev/null +++ b/tests/Unit/Http/Requests/Staff/ApproveApplicationRequestTest.php @@ -0,0 +1,27 @@ +subject = new \App\Http\Requests\Staff\ApproveApplicationRequest(); +}); + +test('rules', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->rules(); + + $this->assertValidationRules([ + 'email' => [ + 'required', + 'string', + 'email', + 'max:70', + 'unique:invites', + 'unique:users', + ], + 'approve' => [ + 'required', + ], + ], $actual); +}); + +// test cases... diff --git a/tests/Unit/Http/Requests/Staff/DestroyDistributorRequestTest.php b/tests/Unit/Http/Requests/Staff/DestroyDistributorRequestTest.php new file mode 100644 index 000000000..cf5df1fca --- /dev/null +++ b/tests/Unit/Http/Requests/Staff/DestroyDistributorRequestTest.php @@ -0,0 +1,19 @@ +subject = new \App\Http\Requests\Staff\DestroyDistributorRequest(); +}); + +test('rules', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->rules(); + + $this->assertValidationRules([ + 'distributor_id' => [ + 'required', + ], + ], $actual); +}); + +// test cases... diff --git a/tests/Unit/Http/Requests/Staff/DestroyRegionRequestTest.php b/tests/Unit/Http/Requests/Staff/DestroyRegionRequestTest.php new file mode 100644 index 000000000..329a0ccea --- /dev/null +++ b/tests/Unit/Http/Requests/Staff/DestroyRegionRequestTest.php @@ -0,0 +1,19 @@ +subject = new \App\Http\Requests\Staff\DestroyRegionRequest(); +}); + +test('rules', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->rules(); + + $this->assertValidationRules([ + 'region_id' => [ + 'required', + ], + ], $actual); +}); + +// test cases... diff --git a/tests/Unit/Http/Requests/Staff/RejectApplicationRequestTest.php b/tests/Unit/Http/Requests/Staff/RejectApplicationRequestTest.php new file mode 100644 index 000000000..a189196ae --- /dev/null +++ b/tests/Unit/Http/Requests/Staff/RejectApplicationRequestTest.php @@ -0,0 +1,17 @@ +subject = new \App\Http\Requests\Staff\RejectApplicationRequest(); +}); + +test('rules', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->rules(); + + $this->assertValidationRules([ + 'deny' => 'required', + ], $actual); +}); + +// test cases... diff --git a/tests/Unit/Http/Requests/Staff/StoreArticleRequestTest.php b/tests/Unit/Http/Requests/Staff/StoreArticleRequestTest.php new file mode 100644 index 000000000..7b4362df3 --- /dev/null +++ b/tests/Unit/Http/Requests/Staff/StoreArticleRequestTest.php @@ -0,0 +1,37 @@ +subject = new \App\Http\Requests\Staff\StoreArticleRequest(); +}); + +test('authorize', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->authorize(); + + $this->assertTrue($actual); +}); + +test('rules', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->rules(); + + $this->assertValidationRules([ + 'title' => [ + 'required', + 'string', + 'max:255', + ], + 'content' => [ + 'required', + 'string', + 'max:65536', + ], + 'image' => [ + 'max:10240', + ], + ], $actual); +}); + +// test cases... diff --git a/tests/Unit/Http/Requests/Staff/StoreBanRequestTest.php b/tests/Unit/Http/Requests/Staff/StoreBanRequestTest.php new file mode 100644 index 000000000..10dc5f78d --- /dev/null +++ b/tests/Unit/Http/Requests/Staff/StoreBanRequestTest.php @@ -0,0 +1,31 @@ +subject = new \App\Http\Requests\Staff\StoreBanRequest(); +}); + +test('authorize', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->authorize(); + + $this->assertTrue($actual); +}); + +test('rules', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->rules(); + + $this->assertValidationRules([ + 'owned_by' => [ + ], + 'ban_reason' => [ + 'required', + 'string', + 'max:65536', + ], + ], $actual); +}); + +// test cases... diff --git a/tests/Unit/Http/Requests/Staff/StoreBlacklistClientRequestTest.php b/tests/Unit/Http/Requests/Staff/StoreBlacklistClientRequestTest.php new file mode 100644 index 000000000..ae23d49e1 --- /dev/null +++ b/tests/Unit/Http/Requests/Staff/StoreBlacklistClientRequestTest.php @@ -0,0 +1,33 @@ +subject = new \App\Http\Requests\Staff\StoreBlacklistClientRequest(); +}); + +test('authorize', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->authorize(); + + $this->assertTrue($actual); +}); + +test('rules', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->rules(); + + $this->assertValidationRules([ + 'name' => [ + 'required', + 'string', + 'unique:blacklist_clients', + ], + 'reason' => [ + 'sometimes', + 'string', + ], + ], $actual); +}); + +// test cases... diff --git a/tests/Unit/Http/Requests/Staff/StoreBonExchangeRequestTest.php b/tests/Unit/Http/Requests/Staff/StoreBonExchangeRequestTest.php new file mode 100644 index 000000000..726a86e50 --- /dev/null +++ b/tests/Unit/Http/Requests/Staff/StoreBonExchangeRequestTest.php @@ -0,0 +1,42 @@ +subject = new \App\Http\Requests\Staff\StoreBonExchangeRequest(); +}); + +test('authorize', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->authorize(); + + $this->assertTrue($actual); +}); + +test('rules', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->rules(); + + $this->assertValidationRules([ + 'description' => [ + 'required', + 'string', + ], + 'value' => [ + 'required', + 'numeric', + ], + 'cost' => [ + 'required', + 'numeric', + ], + 'type' => [ + 'required', + 'string', + 'in:upload,download,personal_freeleech,invite', + 'exclude', + ], + ], $actual); +}); + +// test cases... diff --git a/tests/Unit/Http/Requests/Staff/StoreCategoryRequestTest.php b/tests/Unit/Http/Requests/Staff/StoreCategoryRequestTest.php new file mode 100644 index 000000000..e4896cdca --- /dev/null +++ b/tests/Unit/Http/Requests/Staff/StoreCategoryRequestTest.php @@ -0,0 +1,45 @@ +subject = new \App\Http\Requests\Staff\StoreCategoryRequest(); +}); + +test('authorize', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->authorize(); + + $this->assertTrue($actual); +}); + +test('rules', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->rules(); + + $this->assertValidationRules([ + 'name' => [ + 'required', + 'string', + ], + 'position' => [ + 'required', + 'numeric', + ], + 'icon' => [ + 'required', + 'string', + ], + 'meta' => [ + 'required', + 'string', + 'in:movie,tv,game,music,no', + 'exclude', + ], + 'image' => [ + 'max:10240', + ], + ], $actual); +}); + +// test cases... diff --git a/tests/Unit/Http/Requests/Staff/StoreChatRoomRequestTest.php b/tests/Unit/Http/Requests/Staff/StoreChatRoomRequestTest.php new file mode 100644 index 000000000..96ddc3226 --- /dev/null +++ b/tests/Unit/Http/Requests/Staff/StoreChatRoomRequestTest.php @@ -0,0 +1,29 @@ +subject = new \App\Http\Requests\Staff\StoreChatRoomRequest(); +}); + +test('authorize', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->authorize(); + + $this->assertTrue($actual); +}); + +test('rules', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->rules(); + + $this->assertValidationRules([ + 'name' => [ + 'required', + 'string', + 'max:255', + ], + ], $actual); +}); + +// test cases... diff --git a/tests/Unit/Http/Requests/Staff/StoreChatStatusRequestTest.php b/tests/Unit/Http/Requests/Staff/StoreChatStatusRequestTest.php new file mode 100644 index 000000000..5b7829bce --- /dev/null +++ b/tests/Unit/Http/Requests/Staff/StoreChatStatusRequestTest.php @@ -0,0 +1,33 @@ +subject = new \App\Http\Requests\Staff\StoreChatStatusRequest(); +}); + +test('authorize', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->authorize(); + + $this->assertTrue($actual); +}); + +test('rules', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->rules(); + + $this->assertValidationRules([ + 'name' => [ + 'required', + ], + 'color' => [ + 'required', + ], + 'icon' => [ + 'required', + ], + ], $actual); +}); + +// test cases... diff --git a/tests/Unit/Http/Requests/Staff/StoreDistributorRequestTest.php b/tests/Unit/Http/Requests/Staff/StoreDistributorRequestTest.php new file mode 100644 index 000000000..913ae1a1f --- /dev/null +++ b/tests/Unit/Http/Requests/Staff/StoreDistributorRequestTest.php @@ -0,0 +1,31 @@ +subject = new \App\Http\Requests\Staff\StoreDistributorRequest(); +}); + +test('authorize', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->authorize(); + + $this->assertTrue($actual); +}); + +test('rules', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->rules(); + + $this->assertValidationRules([ + 'name' => [ + 'required', + 'unique:distributors,name', + ], + 'position' => [ + 'required', + ], + ], $actual); +}); + +// test cases... diff --git a/tests/Unit/Http/Requests/Staff/StoreForumRequestTest.php b/tests/Unit/Http/Requests/Staff/StoreForumRequestTest.php new file mode 100644 index 000000000..468260440 --- /dev/null +++ b/tests/Unit/Http/Requests/Staff/StoreForumRequestTest.php @@ -0,0 +1,61 @@ +subject = new \App\Http\Requests\Staff\StoreForumRequest(); +}); + +test('authorize', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->authorize(); + + $this->assertTrue($actual); +}); + +test('rules', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->rules(); + + $this->assertValidationRules([ + 'name' => [ + 'required', + ], + 'position' => [ + 'required', + ], + 'description' => [ + 'required', + ], + 'parent_id' => [ + 'required', + 'integer', + ], + 'permissions' => [ + 'sometimes', + 'array', + ], + 'permissions.*' => [ + 'sometimes', + 'exists:groups,id', + ], + 'permissions.*.show_forum' => [ + 'sometimes', + 'boolean', + ], + 'permissions.*.read_topic' => [ + 'sometimes', + 'boolean', + ], + 'permissions.*.reply_topic' => [ + 'sometimes', + 'boolean', + ], + 'permissions.*.start_topic' => [ + 'sometimes', + 'boolean', + ], + ], $actual); +}); + +// test cases... diff --git a/tests/Unit/Http/Requests/Staff/StoreGiftRequestTest.php b/tests/Unit/Http/Requests/Staff/StoreGiftRequestTest.php new file mode 100644 index 000000000..7fcff280a --- /dev/null +++ b/tests/Unit/Http/Requests/Staff/StoreGiftRequestTest.php @@ -0,0 +1,44 @@ +subject = new \App\Http\Requests\Staff\StoreGiftRequest(); +}); + +test('authorize', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->authorize(); + + $this->assertTrue($actual); +}); + +test('rules', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->rules(); + + $this->assertValidationRules([ + 'username' => [ + 'required', + 'exists:users,username', + 'max:180', + ], + 'seedbonus' => [ + 'required', + 'integer', + 'min:0', + ], + 'invites' => [ + 'required', + 'integer', + 'min:0', + ], + 'fl_tokens' => [ + 'required', + 'integer', + 'min:0', + ], + ], $actual); +}); + +// test cases... diff --git a/tests/Unit/Http/Requests/Staff/StoreGroupRequestTest.php b/tests/Unit/Http/Requests/Staff/StoreGroupRequestTest.php new file mode 100644 index 000000000..897307412 --- /dev/null +++ b/tests/Unit/Http/Requests/Staff/StoreGroupRequestTest.php @@ -0,0 +1,94 @@ +subject = new \App\Http\Requests\Staff\StoreGroupRequest(); +}); + +test('authorize', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->authorize(); + + $this->assertTrue($actual); +}); + +test('rules', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->rules(); + + $this->assertValidationRules([ + 'name' => [ + 'required', + 'string', + 'unique:groups', + ], + 'position' => [ + 'required', + 'integer', + ], + 'level' => [ + 'required', + 'integer', + ], + 'download_slots' => [ + 'nullable', + 'integer', + ], + 'color' => [ + 'required', + ], + 'icon' => [ + 'required', + ], + 'effect' => [ + 'sometimes', + ], + 'is_internal' => [ + 'required', + 'boolean', + ], + 'is_modo' => [ + 'required', + 'boolean', + ], + 'is_admin' => [ + 'required', + 'boolean', + ], + 'is_owner' => [ + 'required', + 'boolean', + ], + 'is_trusted' => [ + 'required', + 'boolean', + ], + 'is_immune' => [ + 'required', + 'boolean', + ], + 'is_freeleech' => [ + 'required', + 'boolean', + ], + 'is_double_upload' => [ + 'required', + 'boolean', + ], + 'is_incognito' => [ + 'required', + 'boolean', + ], + 'can_upload' => [ + 'required', + 'boolean', + ], + 'autogroup' => [ + 'required', + 'boolean', + ], + ], $actual); +}); + +// test cases... diff --git a/tests/Unit/Http/Requests/Staff/StoreInternalRequestTest.php b/tests/Unit/Http/Requests/Staff/StoreInternalRequestTest.php new file mode 100644 index 000000000..e22349737 --- /dev/null +++ b/tests/Unit/Http/Requests/Staff/StoreInternalRequestTest.php @@ -0,0 +1,33 @@ +subject = new \App\Http\Requests\Staff\StoreInternalRequest(); +}); + +test('authorize', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->authorize(); + + $this->assertTrue($actual); +}); + +test('rules', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->rules(); + + $this->assertValidationRules([ + 'name' => [ + 'required', + ], + 'icon' => [ + 'required', + ], + 'effect' => [ + 'required', + ], + ], $actual); +}); + +// test cases... diff --git a/tests/Unit/Http/Requests/Staff/StoreMassActionRequestTest.php b/tests/Unit/Http/Requests/Staff/StoreMassActionRequestTest.php new file mode 100644 index 000000000..ea2c28538 --- /dev/null +++ b/tests/Unit/Http/Requests/Staff/StoreMassActionRequestTest.php @@ -0,0 +1,34 @@ +subject = new \App\Http\Requests\Staff\StoreMassActionRequest(); +}); + +test('authorize', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->authorize(); + + $this->assertTrue($actual); +}); + +test('rules', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->rules(); + + $this->assertValidationRules([ + 'subject' => [ + 'required', + 'string', + 'max:255', + ], + 'message' => [ + 'required', + 'string', + 'max:65536', + ], + ], $actual); +}); + +// test cases... diff --git a/tests/Unit/Http/Requests/Staff/StoreMediaLanguageRequestTest.php b/tests/Unit/Http/Requests/Staff/StoreMediaLanguageRequestTest.php new file mode 100644 index 000000000..564c5a8de --- /dev/null +++ b/tests/Unit/Http/Requests/Staff/StoreMediaLanguageRequestTest.php @@ -0,0 +1,34 @@ +subject = new \App\Http\Requests\Staff\StoreMediaLanguageRequest(); +}); + +test('authorize', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->authorize(); + + $this->assertTrue($actual); +}); + +test('rules', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->rules(); + + $this->assertValidationRules([ + 'name' => [ + 'required', + 'string', + 'unique:media_languages', + ], + 'code' => [ + 'required', + 'string', + 'unique:media_languages', + ], + ], $actual); +}); + +// test cases... diff --git a/tests/Unit/Http/Requests/Staff/StoreNoteRequestTest.php b/tests/Unit/Http/Requests/Staff/StoreNoteRequestTest.php new file mode 100644 index 000000000..07ca7b539 --- /dev/null +++ b/tests/Unit/Http/Requests/Staff/StoreNoteRequestTest.php @@ -0,0 +1,28 @@ +subject = new \App\Http\Requests\Staff\StoreNoteRequest(); +}); + +test('authorize', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->authorize(); + + $this->assertTrue($actual); +}); + +test('rules', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->rules(); + + $this->assertValidationRules([ + 'message' => [ + 'required', + 'string', + ], + ], $actual); +}); + +// test cases... diff --git a/tests/Unit/Http/Requests/Staff/StorePageRequestTest.php b/tests/Unit/Http/Requests/Staff/StorePageRequestTest.php new file mode 100644 index 000000000..5c1253466 --- /dev/null +++ b/tests/Unit/Http/Requests/Staff/StorePageRequestTest.php @@ -0,0 +1,32 @@ +subject = new \App\Http\Requests\Staff\StorePageRequest(); +}); + +test('authorize', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->authorize(); + + $this->assertTrue($actual); +}); + +test('rules', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->rules(); + + $this->assertValidationRules([ + 'name' => [ + 'required', + 'string', + ], + 'content' => [ + 'required', + 'string', + ], + ], $actual); +}); + +// test cases... diff --git a/tests/Unit/Http/Requests/Staff/StoreRegionRequestTest.php b/tests/Unit/Http/Requests/Staff/StoreRegionRequestTest.php new file mode 100644 index 000000000..3f7948b46 --- /dev/null +++ b/tests/Unit/Http/Requests/Staff/StoreRegionRequestTest.php @@ -0,0 +1,31 @@ +subject = new \App\Http\Requests\Staff\StoreRegionRequest(); +}); + +test('authorize', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->authorize(); + + $this->assertTrue($actual); +}); + +test('rules', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->rules(); + + $this->assertValidationRules([ + 'name' => [ + 'required', + 'unique:regions,name', + ], + 'position' => [ + 'required', + ], + ], $actual); +}); + +// test cases... diff --git a/tests/Unit/Http/Requests/Staff/StoreResolutionRequestTest.php b/tests/Unit/Http/Requests/Staff/StoreResolutionRequestTest.php new file mode 100644 index 000000000..6c5ad05a6 --- /dev/null +++ b/tests/Unit/Http/Requests/Staff/StoreResolutionRequestTest.php @@ -0,0 +1,30 @@ +subject = new \App\Http\Requests\Staff\StoreResolutionRequest(); +}); + +test('authorize', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->authorize(); + + $this->assertTrue($actual); +}); + +test('rules', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->rules(); + + $this->assertValidationRules([ + 'name' => [ + 'required', + ], + 'position' => [ + 'required', + ], + ], $actual); +}); + +// test cases... diff --git a/tests/Unit/Http/Requests/Staff/StoreRssRequestTest.php b/tests/Unit/Http/Requests/Staff/StoreRssRequestTest.php new file mode 100644 index 000000000..d28b44341 --- /dev/null +++ b/tests/Unit/Http/Requests/Staff/StoreRssRequestTest.php @@ -0,0 +1,147 @@ +subject = new \App\Http\Requests\Staff\StoreRssRequest(); +}); + +test('authorize', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->authorize(); + + $this->assertTrue($actual); +}); + +test('rules', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->rules(); + + $this->assertValidationRules([ + 'name' => [ + 'required', + 'min:3', + 'max:255', + ], + 'search' => [ + 'max:255', + ], + 'description' => [ + 'max:255', + ], + 'uploader' => [ + 'max:255', + ], + 'categories' => [ + 'sometimes', + 'array', + 'max:999', + ], + 'categories.*' => [ + 'sometimes', + 'exists:categories,id', + ], + 'types' => [ + 'sometimes', + 'array', + 'max:999', + ], + 'types.*' => [ + 'sometimes', + 'exists:types,id', + ], + 'resolutions' => [ + 'sometimes', + 'array', + 'max:999', + ], + 'resolutions.*' => [ + 'sometimes', + 'exists:resolutions,id', + ], + 'genres' => [ + 'sometimes', + 'array', + 'max:999', + ], + 'genres.*' => [ + 'sometimes', + 'exists:genres,id', + ], + 'position' => [ + 'sometimes', + 'integer', + 'max:9999', + ], + 'imdb' => [ + 'sometimes', + 'nullable', + 'integer', + ], + 'tvdb' => [ + 'sometimes', + 'nullable', + 'integer', + ], + 'tmdb' => [ + 'sometimes', + 'nullable', + 'integer', + ], + 'mal' => [ + 'sometimes', + 'nullable', + 'integer', + ], + 'freeleech' => [ + 'sometimes', + 'boolean', + ], + 'doubleupload' => [ + 'sometimes', + 'boolean', + ], + 'featured' => [ + 'sometimes', + 'boolean', + ], + 'stream' => [ + 'sometimes', + 'boolean', + ], + 'highspeed' => [ + 'sometimes', + 'boolean', + ], + 'sd' => [ + 'sometimes', + 'boolean', + ], + 'internal' => [ + 'sometimes', + 'boolean', + ], + 'personalrelease' => [ + 'sometimes', + 'boolean', + ], + 'bookmark' => [ + 'sometimes', + 'boolean', + ], + 'alive' => [ + 'sometimes', + 'boolean', + ], + 'dying' => [ + 'sometimes', + 'boolean', + ], + 'dead' => [ + 'sometimes', + 'boolean', + ], + ], $actual); +}); + +// test cases... diff --git a/tests/Unit/Http/Requests/Staff/StoreTypeRequestTest.php b/tests/Unit/Http/Requests/Staff/StoreTypeRequestTest.php new file mode 100644 index 000000000..a64c95bd9 --- /dev/null +++ b/tests/Unit/Http/Requests/Staff/StoreTypeRequestTest.php @@ -0,0 +1,30 @@ +subject = new \App\Http\Requests\Staff\StoreTypeRequest(); +}); + +test('authorize', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->authorize(); + + $this->assertTrue($actual); +}); + +test('rules', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->rules(); + + $this->assertValidationRules([ + 'name' => [ + 'required', + ], + 'position' => [ + 'required', + ], + ], $actual); +}); + +// test cases... diff --git a/tests/Unit/Http/Requests/Staff/StoreUnbanRequestTest.php b/tests/Unit/Http/Requests/Staff/StoreUnbanRequestTest.php new file mode 100644 index 000000000..0dc73604a --- /dev/null +++ b/tests/Unit/Http/Requests/Staff/StoreUnbanRequestTest.php @@ -0,0 +1,36 @@ +subject = new \App\Http\Requests\Staff\StoreUnbanRequest(); +}); + +test('authorize', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->authorize(); + + $this->assertTrue($actual); +}); + +test('rules', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->rules(); + + $this->assertValidationRules([ + 'owned_by' => [ + ], + 'unban_reason' => [ + 'required', + 'string', + 'max:65536', + ], + 'group_id' => [ + 'required', + 'integer', + 'exists:groups,id', + ], + ], $actual); +}); + +// test cases... diff --git a/tests/Unit/Http/Requests/Staff/StoreWatchedUserRequestTest.php b/tests/Unit/Http/Requests/Staff/StoreWatchedUserRequestTest.php new file mode 100644 index 000000000..4b0814a8e --- /dev/null +++ b/tests/Unit/Http/Requests/Staff/StoreWatchedUserRequestTest.php @@ -0,0 +1,32 @@ +subject = new \App\Http\Requests\Staff\StoreWatchedUserRequest(); +}); + +test('authorize', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->authorize(); + + $this->assertTrue($actual); +}); + +test('rules', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->rules(); + + $this->assertValidationRules([ + 'message' => [ + 'required', + 'string', + 'min:3', + ], + 'user_id' => [ + 'required', + ], + ], $actual); +}); + +// test cases... diff --git a/tests/Unit/Http/Requests/Staff/UpdateArticleRequestTest.php b/tests/Unit/Http/Requests/Staff/UpdateArticleRequestTest.php new file mode 100644 index 000000000..f6c279fcb --- /dev/null +++ b/tests/Unit/Http/Requests/Staff/UpdateArticleRequestTest.php @@ -0,0 +1,37 @@ +subject = new \App\Http\Requests\Staff\UpdateArticleRequest(); +}); + +test('authorize', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->authorize(); + + $this->assertTrue($actual); +}); + +test('rules', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->rules(); + + $this->assertValidationRules([ + 'title' => [ + 'required', + 'string', + 'max:255', + ], + 'content' => [ + 'required', + 'string', + 'max:65536', + ], + 'image' => [ + 'max:10240', + ], + ], $actual); +}); + +// test cases... diff --git a/tests/Unit/Http/Requests/Staff/UpdateBlacklistClientRequestTest.php b/tests/Unit/Http/Requests/Staff/UpdateBlacklistClientRequestTest.php new file mode 100644 index 000000000..3e6d3e562 --- /dev/null +++ b/tests/Unit/Http/Requests/Staff/UpdateBlacklistClientRequestTest.php @@ -0,0 +1,34 @@ +subject = new \App\Http\Requests\Staff\UpdateBlacklistClientRequest(); +}); + +test('authorize', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->authorize(); + + $this->assertTrue($actual); +}); + +test('rules', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->rules(); + + $this->assertValidationRules([ + 'name' => [ + 'required', + 'string', + 'max:255', + ], + 'reason' => [ + 'required', + 'string', + 'max:65536', + ], + ], $actual); +}); + +// test cases... diff --git a/tests/Unit/Http/Requests/Staff/UpdateBonExchangeRequestTest.php b/tests/Unit/Http/Requests/Staff/UpdateBonExchangeRequestTest.php new file mode 100644 index 000000000..91c5e01bc --- /dev/null +++ b/tests/Unit/Http/Requests/Staff/UpdateBonExchangeRequestTest.php @@ -0,0 +1,42 @@ +subject = new \App\Http\Requests\Staff\UpdateBonExchangeRequest(); +}); + +test('authorize', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->authorize(); + + $this->assertTrue($actual); +}); + +test('rules', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->rules(); + + $this->assertValidationRules([ + 'description' => [ + 'required', + 'string', + ], + 'value' => [ + 'required', + 'numeric', + ], + 'cost' => [ + 'required', + 'numeric', + ], + 'type' => [ + 'required', + 'string', + 'in:upload,download,personal_freeleech,invite', + 'exclude', + ], + ], $actual); +}); + +// test cases... diff --git a/tests/Unit/Http/Requests/Staff/UpdateCategoryRequestTest.php b/tests/Unit/Http/Requests/Staff/UpdateCategoryRequestTest.php new file mode 100644 index 000000000..dd847edec --- /dev/null +++ b/tests/Unit/Http/Requests/Staff/UpdateCategoryRequestTest.php @@ -0,0 +1,45 @@ +subject = new \App\Http\Requests\Staff\UpdateCategoryRequest(); +}); + +test('authorize', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->authorize(); + + $this->assertTrue($actual); +}); + +test('rules', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->rules(); + + $this->assertValidationRules([ + 'name' => [ + 'required', + 'string', + ], + 'position' => [ + 'required', + 'numeric', + ], + 'icon' => [ + 'required', + 'string', + ], + 'meta' => [ + 'required', + 'string', + 'in:movie,tv,game,music,no', + 'exclude', + ], + 'image' => [ + 'max:10240', + ], + ], $actual); +}); + +// test cases... diff --git a/tests/Unit/Http/Requests/Staff/UpdateChatBotRequestTest.php b/tests/Unit/Http/Requests/Staff/UpdateChatBotRequestTest.php new file mode 100644 index 000000000..677609852 --- /dev/null +++ b/tests/Unit/Http/Requests/Staff/UpdateChatBotRequestTest.php @@ -0,0 +1,59 @@ +subject = new \App\Http\Requests\Staff\UpdateChatBotRequest(); +}); + +test('authorize', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->authorize(); + + $this->assertTrue($actual); +}); + +test('rules', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->rules(); + + $this->assertValidationRules([ + 'name' => [ + 'required', + 'min:1', + 'max:255', + ], + 'command' => [ + 'required', + 'alpha_dash', + 'min:1', + 'max:255', + ], + 'position' => [ + 'required', + ], + 'color' => [ + 'required', + ], + 'icon' => [ + 'required', + ], + 'emoji' => [ + 'required', + ], + 'help' => [ + 'sometimes', + 'max:9999', + ], + 'info' => [ + 'sometimes', + 'max:9999', + ], + 'about' => [ + 'sometimes', + 'max:9999', + ], + ], $actual); +}); + +// test cases... diff --git a/tests/Unit/Http/Requests/Staff/UpdateChatRoomRequestTest.php b/tests/Unit/Http/Requests/Staff/UpdateChatRoomRequestTest.php new file mode 100644 index 000000000..f9cd04b44 --- /dev/null +++ b/tests/Unit/Http/Requests/Staff/UpdateChatRoomRequestTest.php @@ -0,0 +1,29 @@ +subject = new \App\Http\Requests\Staff\UpdateChatRoomRequest(); +}); + +test('authorize', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->authorize(); + + $this->assertTrue($actual); +}); + +test('rules', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->rules(); + + $this->assertValidationRules([ + 'name' => [ + 'required', + 'string', + 'max:255', + ], + ], $actual); +}); + +// test cases... diff --git a/tests/Unit/Http/Requests/Staff/UpdateChatStatusRequestTest.php b/tests/Unit/Http/Requests/Staff/UpdateChatStatusRequestTest.php new file mode 100644 index 000000000..cf8f4b236 --- /dev/null +++ b/tests/Unit/Http/Requests/Staff/UpdateChatStatusRequestTest.php @@ -0,0 +1,33 @@ +subject = new \App\Http\Requests\Staff\UpdateChatStatusRequest(); +}); + +test('authorize', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->authorize(); + + $this->assertTrue($actual); +}); + +test('rules', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->rules(); + + $this->assertValidationRules([ + 'name' => [ + 'required', + ], + 'color' => [ + 'required', + ], + 'icon' => [ + 'required', + ], + ], $actual); +}); + +// test cases... diff --git a/tests/Unit/Http/Requests/Staff/UpdateDistributorRequestTest.php b/tests/Unit/Http/Requests/Staff/UpdateDistributorRequestTest.php new file mode 100644 index 000000000..c90a09652 --- /dev/null +++ b/tests/Unit/Http/Requests/Staff/UpdateDistributorRequestTest.php @@ -0,0 +1,30 @@ +subject = new \App\Http\Requests\Staff\UpdateDistributorRequest(); +}); + +test('authorize', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->authorize(); + + $this->assertTrue($actual); +}); + +test('rules', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->rules(); + + $this->assertValidationRules([ + 'name' => [ + 'required', + ], + 'position' => [ + 'required', + ], + ], $actual); +}); + +// test cases... diff --git a/tests/Unit/Http/Requests/Staff/UpdateForumRequestTest.php b/tests/Unit/Http/Requests/Staff/UpdateForumRequestTest.php new file mode 100644 index 000000000..4f7357c54 --- /dev/null +++ b/tests/Unit/Http/Requests/Staff/UpdateForumRequestTest.php @@ -0,0 +1,58 @@ +subject = new \App\Http\Requests\Staff\UpdateForumRequest(); +}); + +test('authorize', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->authorize(); + + $this->assertTrue($actual); +}); + +test('rules', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->rules(); + + $this->assertValidationRules([ + 'name' => [ + 'required', + ], + 'position' => [ + 'required', + ], + 'description' => [ + 'required', + ], + 'parent_id' => [ + 'required', + 'integer', + ], + 'permissions' => [ + 'array', + ], + 'permissions.*' => [ + 'exists:groups,id', + ], + 'permissions.*.show_forum' => [ + 'boolean', + ], + 'permissions.*.read_topic' => [ + 'boolean', + ], + 'permissions.*.reply_topic' => [ + 'boolean', + ], + 'permissions.*.start_topic' => [ + 'boolean', + ], + 'forum_type' => [ + 'in:category,forum', + ], + ], $actual); +}); + +// test cases... diff --git a/tests/Unit/Http/Requests/Staff/UpdateGroupRequestTest.php b/tests/Unit/Http/Requests/Staff/UpdateGroupRequestTest.php new file mode 100644 index 000000000..b99c6912c --- /dev/null +++ b/tests/Unit/Http/Requests/Staff/UpdateGroupRequestTest.php @@ -0,0 +1,93 @@ +subject = new \App\Http\Requests\Staff\UpdateGroupRequest(); +}); + +test('authorize', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->authorize(); + + $this->assertTrue($actual); +}); + +test('rules', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->rules(); + + $this->assertValidationRules([ + 'name' => [ + 'required', + 'string', + ], + 'position' => [ + 'required', + 'integer', + ], + 'level' => [ + 'required', + 'integer', + ], + 'download_slots' => [ + 'nullable', + 'integer', + ], + 'color' => [ + 'required', + ], + 'icon' => [ + 'required', + ], + 'effect' => [ + 'sometimes', + ], + 'is_internal' => [ + 'required', + 'boolean', + ], + 'is_modo' => [ + 'required', + 'boolean', + ], + 'is_admin' => [ + 'required', + 'boolean', + ], + 'is_owner' => [ + 'required', + 'boolean', + ], + 'is_trusted' => [ + 'required', + 'boolean', + ], + 'is_immune' => [ + 'required', + 'boolean', + ], + 'is_freeleech' => [ + 'required', + 'boolean', + ], + 'is_double_upload' => [ + 'required', + 'boolean', + ], + 'is_incognito' => [ + 'required', + 'boolean', + ], + 'can_upload' => [ + 'required', + 'boolean', + ], + 'autogroup' => [ + 'required', + 'boolean', + ], + ], $actual); +}); + +// test cases... diff --git a/tests/Unit/Http/Requests/Staff/UpdateInternalRequestTest.php b/tests/Unit/Http/Requests/Staff/UpdateInternalRequestTest.php new file mode 100644 index 000000000..9c7cbf05d --- /dev/null +++ b/tests/Unit/Http/Requests/Staff/UpdateInternalRequestTest.php @@ -0,0 +1,33 @@ +subject = new \App\Http\Requests\Staff\UpdateInternalRequest(); +}); + +test('authorize', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->authorize(); + + $this->assertTrue($actual); +}); + +test('rules', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->rules(); + + $this->assertValidationRules([ + 'name' => [ + 'required', + ], + 'icon' => [ + 'required', + ], + 'effect' => [ + 'required', + ], + ], $actual); +}); + +// test cases... diff --git a/tests/Unit/Http/Requests/Staff/UpdateMediaLanguageRequestTest.php b/tests/Unit/Http/Requests/Staff/UpdateMediaLanguageRequestTest.php new file mode 100644 index 000000000..6738af9e2 --- /dev/null +++ b/tests/Unit/Http/Requests/Staff/UpdateMediaLanguageRequestTest.php @@ -0,0 +1,32 @@ +subject = new \App\Http\Requests\Staff\UpdateMediaLanguageRequest(); +}); + +test('authorize', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->authorize(); + + $this->assertTrue($actual); +}); + +test('rules', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->rules(); + + $this->assertValidationRules([ + 'name' => [ + 'required', + 'string', + ], + 'code' => [ + 'required', + 'string', + ], + ], $actual); +}); + +// test cases... diff --git a/tests/Unit/Http/Requests/Staff/UpdateModerationRequestTest.php b/tests/Unit/Http/Requests/Staff/UpdateModerationRequestTest.php new file mode 100644 index 000000000..96858caaa --- /dev/null +++ b/tests/Unit/Http/Requests/Staff/UpdateModerationRequestTest.php @@ -0,0 +1,32 @@ +subject = new \App\Http\Requests\Staff\UpdateModerationRequest(); +}); + +test('authorize', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->authorize(); + + $this->assertTrue($actual); +}); + +test('rules', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->rules(); + + $this->assertValidationRules([ + 'old_status' => [ + 'required', + ], + 'status' => [ + 'required', + ], + 'message' => [ + ], + ], $actual); +}); + +// test cases... diff --git a/tests/Unit/Http/Requests/Staff/UpdatePageRequestTest.php b/tests/Unit/Http/Requests/Staff/UpdatePageRequestTest.php new file mode 100644 index 000000000..2a88fd3d2 --- /dev/null +++ b/tests/Unit/Http/Requests/Staff/UpdatePageRequestTest.php @@ -0,0 +1,32 @@ +subject = new \App\Http\Requests\Staff\UpdatePageRequest(); +}); + +test('authorize', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->authorize(); + + $this->assertTrue($actual); +}); + +test('rules', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->rules(); + + $this->assertValidationRules([ + 'name' => [ + 'required', + 'string', + ], + 'content' => [ + 'required', + 'string', + ], + ], $actual); +}); + +// test cases... diff --git a/tests/Unit/Http/Requests/Staff/UpdateRegionRequestTest.php b/tests/Unit/Http/Requests/Staff/UpdateRegionRequestTest.php new file mode 100644 index 000000000..aad37d436 --- /dev/null +++ b/tests/Unit/Http/Requests/Staff/UpdateRegionRequestTest.php @@ -0,0 +1,30 @@ +subject = new \App\Http\Requests\Staff\UpdateRegionRequest(); +}); + +test('authorize', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->authorize(); + + $this->assertTrue($actual); +}); + +test('rules', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->rules(); + + $this->assertValidationRules([ + 'name' => [ + 'required', + ], + 'position' => [ + 'required', + ], + ], $actual); +}); + +// test cases... diff --git a/tests/Unit/Http/Requests/Staff/UpdateReportRequestTest.php b/tests/Unit/Http/Requests/Staff/UpdateReportRequestTest.php new file mode 100644 index 000000000..b9202a87f --- /dev/null +++ b/tests/Unit/Http/Requests/Staff/UpdateReportRequestTest.php @@ -0,0 +1,28 @@ +subject = new \App\Http\Requests\Staff\UpdateReportRequest(); +}); + +test('authorize', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->authorize(); + + $this->assertTrue($actual); +}); + +test('rules', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->rules(); + + $this->assertValidationRules([ + 'verdict' => [ + 'required', + 'min:3', + ], + ], $actual); +}); + +// test cases... diff --git a/tests/Unit/Http/Requests/Staff/UpdateResolutionRequestTest.php b/tests/Unit/Http/Requests/Staff/UpdateResolutionRequestTest.php new file mode 100644 index 000000000..2fc253458 --- /dev/null +++ b/tests/Unit/Http/Requests/Staff/UpdateResolutionRequestTest.php @@ -0,0 +1,30 @@ +subject = new \App\Http\Requests\Staff\UpdateResolutionRequest(); +}); + +test('authorize', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->authorize(); + + $this->assertTrue($actual); +}); + +test('rules', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->rules(); + + $this->assertValidationRules([ + 'name' => [ + 'required', + ], + 'position' => [ + 'required', + ], + ], $actual); +}); + +// test cases... diff --git a/tests/Unit/Http/Requests/Staff/UpdateRssRequestTest.php b/tests/Unit/Http/Requests/Staff/UpdateRssRequestTest.php new file mode 100644 index 000000000..a6b09b538 --- /dev/null +++ b/tests/Unit/Http/Requests/Staff/UpdateRssRequestTest.php @@ -0,0 +1,147 @@ +subject = new \App\Http\Requests\Staff\UpdateRssRequest(); +}); + +test('authorize', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->authorize(); + + $this->assertTrue($actual); +}); + +test('rules', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->rules(); + + $this->assertValidationRules([ + 'name' => [ + 'required', + 'min:3', + 'max:255', + ], + 'search' => [ + 'max:255', + ], + 'description' => [ + 'max:255', + ], + 'uploader' => [ + 'max:255', + ], + 'categories' => [ + 'sometimes', + 'array', + 'max:999', + ], + 'categories.*' => [ + 'sometimes', + 'exists:categories,id', + ], + 'types' => [ + 'sometimes', + 'array', + 'max:999', + ], + 'types.*' => [ + 'sometimes', + 'exists:types,id', + ], + 'resolutions' => [ + 'sometimes', + 'array', + 'max:999', + ], + 'resolutions.*' => [ + 'sometimes', + 'exists:resolutions,id', + ], + 'genres' => [ + 'sometimes', + 'array', + 'max:999', + ], + 'genres.*' => [ + 'sometimes', + 'exists:genres,id', + ], + 'position' => [ + 'sometimes', + 'integer', + 'max:9999', + ], + 'imdb' => [ + 'sometimes', + 'nullable', + 'integer', + ], + 'tvdb' => [ + 'sometimes', + 'nullable', + 'integer', + ], + 'tmdb' => [ + 'sometimes', + 'nullable', + 'integer', + ], + 'mal' => [ + 'sometimes', + 'nullable', + 'integer', + ], + 'freeleech' => [ + 'sometimes', + 'boolean', + ], + 'doubleupload' => [ + 'sometimes', + 'boolean', + ], + 'featured' => [ + 'sometimes', + 'boolean', + ], + 'stream' => [ + 'sometimes', + 'boolean', + ], + 'highspeed' => [ + 'sometimes', + 'boolean', + ], + 'sd' => [ + 'sometimes', + 'boolean', + ], + 'internal' => [ + 'sometimes', + 'boolean', + ], + 'personalrelease' => [ + 'sometimes', + 'boolean', + ], + 'bookmark' => [ + 'sometimes', + 'boolean', + ], + 'alive' => [ + 'sometimes', + 'boolean', + ], + 'dying' => [ + 'sometimes', + 'boolean', + ], + 'dead' => [ + 'sometimes', + 'boolean', + ], + ], $actual); +}); + +// test cases... diff --git a/tests/Unit/Http/Requests/Staff/UpdateTypeRequestTest.php b/tests/Unit/Http/Requests/Staff/UpdateTypeRequestTest.php new file mode 100644 index 000000000..d3cad4f31 --- /dev/null +++ b/tests/Unit/Http/Requests/Staff/UpdateTypeRequestTest.php @@ -0,0 +1,30 @@ +subject = new \App\Http\Requests\Staff\UpdateTypeRequest(); +}); + +test('authorize', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->authorize(); + + $this->assertTrue($actual); +}); + +test('rules', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->rules(); + + $this->assertValidationRules([ + 'name' => [ + 'required', + ], + 'position' => [ + 'required', + ], + ], $actual); +}); + +// test cases... diff --git a/tests/Unit/Http/Requests/Staff/UpdateUserRequestTest.php b/tests/Unit/Http/Requests/Staff/UpdateUserRequestTest.php new file mode 100644 index 000000000..65a485fe7 --- /dev/null +++ b/tests/Unit/Http/Requests/Staff/UpdateUserRequestTest.php @@ -0,0 +1,70 @@ +subject = new \App\Http\Requests\Staff\UpdateUserRequest(); +}); + +test('authorize', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->authorize(); + + $this->assertTrue($actual); +}); + +test('rules', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->rules(); + + $this->assertValidationRules([ + 'username' => [ + 'required', + ], + 'uploaded' => [ + 'required', + 'integer', + ], + 'downloaded' => [ + 'required', + 'integer', + ], + 'title' => [ + 'nullable', + 'present', + 'string', + 'max:255', + ], + 'about' => [ + 'nullable', + 'present', + 'string', + 'max:16777216', + ], + 'group_id' => [ + 'required', + 'exists:groups,id', + ], + 'internal_id' => [ + 'nullable', + 'exists:internals,id', + ], + 'seedbonus' => [ + 'required', + 'decimal:0,2', + 'min:0', + ], + 'invites' => [ + 'required', + 'integer', + 'min:0', + ], + 'fl_tokens' => [ + 'required', + 'integer', + 'min:0', + ], + ], $actual); +}); + +// test cases... diff --git a/tests/Unit/Http/Requests/StoreGiftRequestTest.php b/tests/Unit/Http/Requests/StoreGiftRequestTest.php new file mode 100644 index 000000000..62fa47acb --- /dev/null +++ b/tests/Unit/Http/Requests/StoreGiftRequestTest.php @@ -0,0 +1,37 @@ +subject = new \App\Http\Requests\StoreGiftRequest(); +}); + +test('authorize', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->authorize(); + + $this->assertTrue($actual); +}); + +test('rules', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->rules(); + + $this->assertValidationRules([ + 'receiver_username' => [ + 'required', + ], + 'cost' => [ + 'required', + 'numeric', + 'min:1', + ], + 'comment' => [ + 'required', + 'string', + 'max:255', + ], + ], $actual); +}); + +// test cases... diff --git a/tests/Unit/Http/Requests/StorePlaylistRequestTest.php b/tests/Unit/Http/Requests/StorePlaylistRequestTest.php new file mode 100644 index 000000000..b834f7641 --- /dev/null +++ b/tests/Unit/Http/Requests/StorePlaylistRequestTest.php @@ -0,0 +1,36 @@ +subject = new \App\Http\Requests\StorePlaylistRequest(); +}); + +test('authorize', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->authorize(); + + $this->assertTrue($actual); +}); + +test('rules', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->rules(); + + $this->assertValidationRules([ + 'name' => [ + 'required', + 'max:255', + ], + 'description' => [ + 'required', + 'max:65535', + ], + 'is_private' => [ + 'required', + 'boolean', + ], + ], $actual); +}); + +// test cases... diff --git a/tests/Unit/Http/Requests/StorePlaylistTorrentRequestTest.php b/tests/Unit/Http/Requests/StorePlaylistTorrentRequestTest.php new file mode 100644 index 000000000..e2511862c --- /dev/null +++ b/tests/Unit/Http/Requests/StorePlaylistTorrentRequestTest.php @@ -0,0 +1,34 @@ +subject = new \App\Http\Requests\StorePlaylistTorrentRequest(); +}); + +test('authorize', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->authorize(); + + $this->assertTrue($actual); +}); + +test('rules', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->rules(); + + $this->assertValidationRules([ + 'playlist_id' => [ + 'required', + 'numeric', + 'integer', + ], + 'torrent_id' => [ + 'required', + 'numeric', + 'integer', + ], + ], $actual); +}); + +// test cases... diff --git a/tests/Unit/Http/Requests/StorePollTest.php b/tests/Unit/Http/Requests/StorePollTest.php new file mode 100644 index 000000000..648cad449 --- /dev/null +++ b/tests/Unit/Http/Requests/StorePollTest.php @@ -0,0 +1,51 @@ +subject = new \App\Http\Requests\StorePoll(); +}); + +test('authorize', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->authorize(); + + $this->assertTrue($actual); +}); + +test('rules', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->rules(); + + $this->assertValidationRules([ + 'title' => [ + 'required', + 'min:10', + ], + 'multiple_choice' => [ + 'required', + 'boolean', + ], + 'options.*.name' => [ + 'required', + 'max:255', + ], + 'options' => [ + 'array', + 'min:2', + 'max:20', + ], + ], $actual); +}); + +test('messages', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->messages(); + + $this->assertEquals([ + 'options.*.required' => 'You must fill in all options fields', + ], $actual); +}); + +// test cases... diff --git a/tests/Unit/Http/Requests/StorePollVoteRequestTest.php b/tests/Unit/Http/Requests/StorePollVoteRequestTest.php new file mode 100644 index 000000000..ec06d7dc5 --- /dev/null +++ b/tests/Unit/Http/Requests/StorePollVoteRequestTest.php @@ -0,0 +1,42 @@ +subject = new \App\Http\Requests\StorePollVoteRequest(); +}); + +test('authorize', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->authorize(); + + $this->assertTrue($actual); +}); + +test('rules', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->rules(); + + $this->assertValidationRules([ + 'options' => [ + 'required', + 'array', + 'min:1', + ], + 'options.*' => [ + 'integer', + ], + ], $actual); +}); + +test('messages', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->messages(); + + $this->assertEquals([ + 'options.required' => 'You must select an answer', + ], $actual); +}); + +// test cases... diff --git a/tests/Unit/Http/Requests/StoreRequestFillRequestTest.php b/tests/Unit/Http/Requests/StoreRequestFillRequestTest.php new file mode 100644 index 000000000..0db2ca076 --- /dev/null +++ b/tests/Unit/Http/Requests/StoreRequestFillRequestTest.php @@ -0,0 +1,31 @@ +subject = new \App\Http\Requests\StoreRequestFillRequest(); +}); + +test('authorize', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->authorize(); + + $this->assertTrue($actual); +}); + +test('rules', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->rules(); + + $this->assertValidationRules([ + 'torrent_id' => [ + 'required', + ], + 'filled_anon' => [ + 'required', + 'boolean', + ], + ], $actual); +}); + +// test cases... diff --git a/tests/Unit/Http/Requests/StoreSubtitleRequestTest.php b/tests/Unit/Http/Requests/StoreSubtitleRequestTest.php new file mode 100644 index 000000000..a69d7bc9d --- /dev/null +++ b/tests/Unit/Http/Requests/StoreSubtitleRequestTest.php @@ -0,0 +1,43 @@ +subject = new \App\Http\Requests\StoreSubtitleRequest(); +}); + +test('authorize', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->authorize(); + + $this->assertTrue($actual); +}); + +test('rules', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->rules(); + + $this->assertValidationRules([ + 'subtitle_file' => [ + 'required', + 'mimes:srt,ass,sup,zip', + ], + 'language_id' => [ + 'required', + ], + 'note' => [ + 'required', + 'max:65535', + ], + 'anon' => [ + 'required', + 'boolean', + ], + 'torrent_id' => [ + 'required', + 'integer', + ], + ], $actual); +}); + +// test cases... diff --git a/tests/Unit/Http/Requests/StoreTicketRequestTest.php b/tests/Unit/Http/Requests/StoreTicketRequestTest.php new file mode 100644 index 000000000..4c6098a2b --- /dev/null +++ b/tests/Unit/Http/Requests/StoreTicketRequestTest.php @@ -0,0 +1,40 @@ +subject = new \App\Http\Requests\StoreTicketRequest(); +}); + +test('authorize', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->authorize(); + + $this->assertTrue($actual); +}); + +test('rules', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->rules(); + + $this->assertValidationRules([ + 'category_id' => [ + 'required', + 'integer', + ], + 'priority_id' => [ + 'required', + 'integer', + ], + 'subject' => [ + 'required', + 'max:255', + ], + 'body' => [ + 'required', + 'max:65535', + ], + ], $actual); +}); + +// test cases... diff --git a/tests/Unit/Http/Requests/StoreTipRequestTest.php b/tests/Unit/Http/Requests/StoreTipRequestTest.php new file mode 100644 index 000000000..8ab31a48f --- /dev/null +++ b/tests/Unit/Http/Requests/StoreTipRequestTest.php @@ -0,0 +1,49 @@ +subject = new \App\Http\Requests\StoreTipRequest(); +}); + +test('authorize', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->authorize(); + + $this->assertTrue($actual); +}); + +test('rules', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->rules(); + + $this->assertValidationRules([ + 'torrent' => [ + 'bail', + 'prohibits:post', + 'required_without:post', + 'exists:torrents,id', + ], + 'post' => [ + 'bail', + 'prohibits:torrent', + 'required_without:torrent', + 'exists:posts,id', + ], + 'tip' => [ + 'required', + 'numeric', + 'min:1', + ], + ], $actual); +}); + +test('messages', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->messages(); + + $this->assertEquals([], $actual); +}); + +// test cases... diff --git a/tests/Unit/Http/Requests/StoreTorrentRequestBountyRequestTest.php b/tests/Unit/Http/Requests/StoreTorrentRequestBountyRequestTest.php new file mode 100644 index 000000000..150645140 --- /dev/null +++ b/tests/Unit/Http/Requests/StoreTorrentRequestBountyRequestTest.php @@ -0,0 +1,33 @@ +subject = new \App\Http\Requests\StoreTorrentRequestBountyRequest(); +}); + +test('authorize', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->authorize(); + + $this->assertTrue($actual); +}); + +test('rules', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->rules(); + + $this->assertValidationRules([ + 'seedbonus' => [ + 'required', + 'numeric', + 'min:100', + ], + 'anon' => [ + 'required', + 'boolean', + ], + ], $actual); +}); + +// test cases... diff --git a/tests/Unit/Http/Requests/StoreTorrentRequestClaimRequestTest.php b/tests/Unit/Http/Requests/StoreTorrentRequestClaimRequestTest.php new file mode 100644 index 000000000..887ac4549 --- /dev/null +++ b/tests/Unit/Http/Requests/StoreTorrentRequestClaimRequestTest.php @@ -0,0 +1,28 @@ +subject = new \App\Http\Requests\StoreTorrentRequestClaimRequest(); +}); + +test('authorize', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->authorize(); + + $this->assertTrue($actual); +}); + +test('rules', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->rules(); + + $this->assertValidationRules([ + 'anon' => [ + 'required', + 'boolean', + ], + ], $actual); +}); + +// test cases... diff --git a/tests/Unit/Http/Requests/StoreTorrentRequestRequestTest.php b/tests/Unit/Http/Requests/StoreTorrentRequestRequestTest.php new file mode 100644 index 000000000..da4cff676 --- /dev/null +++ b/tests/Unit/Http/Requests/StoreTorrentRequestRequestTest.php @@ -0,0 +1,77 @@ +subject = new \App\Http\Requests\StoreTorrentRequestRequest(); +}); + +test('authorize', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->authorize(); + + $this->assertTrue($actual); +}); + +test('rules', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->rules(); + + $this->assertValidationRules([ + 'name' => [ + 'required', + 'max:180', + ], + 'imdb' => [ + ], + 'tvdb' => [ + ], + 'tmdb' => [ + ], + 'mal' => [ + ], + 'igdb' => [ + ], + 'category_id' => [ + 'required', + 'exists:categories,id', + ], + 'type_id' => [ + 'required', + 'exists:types,id', + ], + 'resolution_id' => [ + 'nullable', + 'exists:resolutions,id', + ], + 'description' => [ + 'required', + 'string', + ], + 'bounty' => [ + 'required', + 'numeric', + 'min:100', + ], + 'anon' => [ + 'boolean', + 'required', + ], + ], $actual); +}); + +test('messages', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->messages(); + + $this->assertEquals([ + 'igdb.in' => "The IGBB ID must be 0 if the media doesn't exist on IGDB or you're not requesting a game.", + 'tmdb.in' => "The TMDB ID must be 0 if the media doesn't exist on TMDB or you're not requesting a tv show or movie.", + 'imdb.in' => "The IMDB ID must be 0 if the media doesn't exist on IMDB or you're not requesting a tv show or movie.", + 'tvdb.in' => "The TVDB ID must be 0 if the media doesn't exist on TVDB or you're not requesting a tv show.", + 'mal.in' => "The MAL ID must be 0 if the media doesn't exist on MAL or you're not requesting a tv or movie.", + ], $actual); +}); + +// test cases... diff --git a/tests/Unit/Http/Requests/StoreTorrentRequestTest.php b/tests/Unit/Http/Requests/StoreTorrentRequestTest.php new file mode 100644 index 000000000..0f7218192 --- /dev/null +++ b/tests/Unit/Http/Requests/StoreTorrentRequestTest.php @@ -0,0 +1,126 @@ +subject = new \App\Http\Requests\StoreTorrentRequest(); +}); + +test('authorize', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->authorize(); + + $this->assertTrue($actual); +}); + +test('rules', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->rules(); + + $this->assertValidationRules([ + 'torrent' => [ + 'required', + 'file', + 'mimes:torrent', + 'mimetypes:application/x-bittorrent', + ], + 'name' => [ + 'required', + 'unique:torrents', + 'max:255', + ], + 'description' => [ + 'required', + 'max:4294967296', + ], + 'mediainfo' => [ + 'nullable', + 'sometimes', + 'max:4294967296', + ], + 'bdinfo' => [ + 'nullable', + 'sometimes', + 'max:4294967296', + ], + 'category_id' => [ + 'required', + 'exists:categories,id', + ], + 'type_id' => [ + 'required', + 'exists:types,id', + ], + 'resolution_id' => [ + 'exists:resolutions,id', + ], + 'region_id' => [ + 'nullable', + 'exists:regions,id', + ], + 'distributor_id' => [ + 'nullable', + 'exists:distributors,id', + ], + 'imdb' => [ + ], + 'tvdb' => [ + ], + 'tmdb' => [ + ], + 'mal' => [ + ], + 'igdb' => [ + ], + 'season_number' => [ + ], + 'episode_number' => [ + ], + 'anon' => [ + 'required', + 'boolean', + ], + 'stream' => [ + 'required', + 'boolean', + ], + 'sd' => [ + 'required', + 'boolean', + ], + 'personal_release' => [ + 'required', + 'boolean', + ], + 'internal' => [ + 'sometimes', + 'boolean', + ], + 'free' => [ + 'sometimes', + 'integer', + 'numeric', + 'between:0,100', + ], + 'refundable' => [ + 'sometimes', + 'boolean', + ], + ], $actual); +}); + +test('messages', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->messages(); + + $this->assertEquals([ + 'igdb.in' => "The IGBB ID must be 0 if the media doesn't exist on IGDB or you're not uploading a game.", + 'tmdb.in' => "The TMDB ID must be 0 if the media doesn't exist on TMDB or you're not uploading a tv show or movie.", + 'imdb.in' => "The IMDB ID must be 0 if the media doesn't exist on IMDB or you're not uploading a tv show or movie.", + 'tvdb.in' => "The TVDB ID must be 0 if the media doesn't exist on TVDB or you're not uploading a tv show.", + 'mal.in' => "The MAL ID must be 0 if the media doesn't exist on MAL or you're not uploading a tv or movie.", + ], $actual); +}); + +// test cases... diff --git a/tests/Unit/Http/Requests/StoreTransactionRequestTest.php b/tests/Unit/Http/Requests/StoreTransactionRequestTest.php new file mode 100644 index 000000000..83848717d --- /dev/null +++ b/tests/Unit/Http/Requests/StoreTransactionRequestTest.php @@ -0,0 +1,29 @@ +subject = new \App\Http\Requests\StoreTransactionRequest(); +}); + +test('authorize', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->authorize(); + + $this->assertTrue($actual); +}); + +test('rules', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->rules(); + + $this->assertValidationRules([ + 'exchange' => [ + 'bail', + 'required', + 'exists:bon_exchange,id', + ], + ], $actual); +}); + +// test cases... diff --git a/tests/Unit/Http/Requests/UpdatePlaylistRequestTest.php b/tests/Unit/Http/Requests/UpdatePlaylistRequestTest.php new file mode 100644 index 000000000..f342aad7b --- /dev/null +++ b/tests/Unit/Http/Requests/UpdatePlaylistRequestTest.php @@ -0,0 +1,36 @@ +subject = new \App\Http\Requests\UpdatePlaylistRequest(); +}); + +test('authorize', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->authorize(); + + $this->assertTrue($actual); +}); + +test('rules', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->rules(); + + $this->assertValidationRules([ + 'name' => [ + 'required', + 'max:255', + ], + 'description' => [ + 'required', + 'max:65536', + ], + 'is_private' => [ + 'required', + 'boolean', + ], + ], $actual); +}); + +// test cases... diff --git a/tests/Unit/Http/Requests/UpdatePollRequestTest.php b/tests/Unit/Http/Requests/UpdatePollRequestTest.php new file mode 100644 index 000000000..e3c1ae2bd --- /dev/null +++ b/tests/Unit/Http/Requests/UpdatePollRequestTest.php @@ -0,0 +1,31 @@ +subject = new \App\Http\Requests\UpdatePollRequest(); +}); + +test('rules', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->rules(); + + $this->assertValidationRules([ + 'title' => 'required|min:10', + 'multiple_choice' => 'required|boolean', + 'options.*.name' => 'required|max:255', + 'options.*.id' => 'required|integer', + 'options' => 'array|min:2', + ], $actual); +}); + +test('messages', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->messages(); + + $this->assertEquals([ + 'options.*.required' => 'You must fill in all options fields', + ], $actual); +}); + +// test cases... diff --git a/tests/Unit/Http/Requests/UpdateSubtitleRequestTest.php b/tests/Unit/Http/Requests/UpdateSubtitleRequestTest.php new file mode 100644 index 000000000..d6ef9908a --- /dev/null +++ b/tests/Unit/Http/Requests/UpdateSubtitleRequestTest.php @@ -0,0 +1,35 @@ +subject = new \App\Http\Requests\UpdateSubtitleRequest(); +}); + +test('authorize', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->authorize(); + + $this->assertTrue($actual); +}); + +test('rules', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->rules(); + + $this->assertValidationRules([ + 'language_id' => [ + 'required', + ], + 'note' => [ + 'required', + 'max:65535', + ], + 'anon' => [ + 'required', + 'boolean', + ], + ], $actual); +}); + +// test cases... diff --git a/tests/Unit/Http/Requests/UpdateTorrentRequestRequestTest.php b/tests/Unit/Http/Requests/UpdateTorrentRequestRequestTest.php new file mode 100644 index 000000000..6f9d2d8be --- /dev/null +++ b/tests/Unit/Http/Requests/UpdateTorrentRequestRequestTest.php @@ -0,0 +1,68 @@ +subject = new \App\Http\Requests\UpdateTorrentRequestRequest(); +}); + +test('authorize', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->authorize(); + + $this->assertTrue($actual); +}); + +test('rules', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->rules(); + + $this->assertValidationRules([ + 'name' => [ + 'required', + 'max:180', + ], + 'imdb' => [ + 'required', + 'numeric', + ], + 'tvdb' => [ + 'required', + 'numeric', + ], + 'tmdb' => [ + 'required', + 'numeric', + ], + 'mal' => [ + 'required', + 'numeric', + ], + 'igdb' => [ + 'required', + 'numeric', + ], + 'category_id' => [ + 'required', + 'exists:categories,id', + ], + 'type_id' => [ + 'required', + 'exists:types,id', + ], + 'resolution_id' => [ + 'nullable', + 'exists:resolutions,id', + ], + 'description' => [ + 'required', + 'string', + ], + 'anon' => [ + 'required', + 'boolean', + ], + ], $actual); +}); + +// test cases... diff --git a/tests/Unit/Http/Requests/UpdateTorrentRequestTest.php b/tests/Unit/Http/Requests/UpdateTorrentRequestTest.php new file mode 100644 index 000000000..507159f70 --- /dev/null +++ b/tests/Unit/Http/Requests/UpdateTorrentRequestTest.php @@ -0,0 +1,115 @@ +subject = new \App\Http\Requests\UpdateTorrentRequest(); +}); + +test('authorize', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->authorize(); + + $this->assertTrue($actual); +}); + +test('rules', function (): void { + $this->markTestIncomplete('This test case was generated by Shift. When you are ready, remove this line and complete this test case.'); + + $actual = $this->subject->rules(); + + $this->assertValidationRules([ + 'name' => [ + 'required', + 'max:255', + ], + 'description' => [ + 'required', + 'max:4294967296', + ], + 'mediainfo' => [ + 'nullable', + 'sometimes', + 'max:4294967296', + ], + 'bdinfo' => [ + 'nullable', + 'sometimes', + 'max:4294967296', + ], + 'category_id' => [ + 'required', + 'exists:categories,id', + ], + 'type_id' => [ + 'required', + 'exists:types,id', + ], + 'resolution_id' => [ + 'exists:resolutions,id', + ], + 'region_id' => [ + 'nullable', + 'exists:regions,id', + ], + 'distributor_id' => [ + 'nullable', + 'exists:distributors,id', + ], + 'imdb' => [ + 'required', + 'numeric', + ], + 'tvdb' => [ + 'required', + 'numeric', + ], + 'tmdb' => [ + 'required', + 'numeric', + ], + 'mal' => [ + 'required', + 'numeric', + ], + 'igdb' => [ + 'required', + 'numeric', + ], + 'season_number' => [ + 'numeric', + ], + 'episode_number' => [ + 'numeric', + ], + 'anon' => [ + 'required', + 'boolean', + ], + 'stream' => [ + 'required', + 'boolean', + ], + 'sd' => [ + 'required', + 'boolean', + ], + 'personal_release' => [ + 'required', + 'boolean', + ], + 'internal' => [ + 'sometimes', + 'boolean', + ], + 'free' => [ + 'sometimes', + 'between:0,100', + ], + 'refundable' => [ + 'sometimes', + 'boolean', + ], + ], $actual); +}); + +// test cases...