feat: initial migration to Laravel 10 (#572)

* feat: initial migration to Laravel 10

* style: fix StyleCI findings
This commit is contained in:
paranarimasu
2023-04-18 16:22:36 -05:00
committed by GitHub
parent 1e586c94a0
commit 2e930b17ff
335 changed files with 1272 additions and 1978 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
* text=auto
* text=auto eol=lf
*.blade.php diff=html
*.css diff=css
+1
View File
@@ -1,3 +1,4 @@
/.phpunit.cache
/node_modules
/public/hot
/public/storage
@@ -79,7 +79,7 @@ abstract class BackfillStudiosAction extends BackfillAction
{
$column = Studio::ATTRIBUTE_NAME;
$studio = Studio::query()
->where(DB::raw("lower($column)"), Str::lower($name))
->where(DB::raw("lower($column)")->getValue(DB::connection()->getQueryGrammar()), Str::lower($name))
->first();
if (! $studio instanceof Studio) {
+7
View File
@@ -11,6 +11,7 @@ use App\Console\Commands\Storage\Admin\DumpPruneCommand;
use App\Console\Commands\Storage\Admin\WikiDumpCommand;
use App\Enums\Models\Billing\Service;
use App\Models\BaseModel;
use Illuminate\Cache\Console\PruneStaleTagsCommand;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Database\Console\MonitorCommand as MonitorDatabaseCommand;
use Illuminate\Database\Console\PruneCommand as PruneModelsCommand;
@@ -92,6 +93,12 @@ class Kernel extends ConsoleKernel
->storeOutput()
->daily();
$schedule->command(PruneStaleTagsCommand::class)
->withoutOverlapping()
->runInBackground()
->storeOutput()
->hourly();
if (Config::bool('telescope.enabled')) {
$schedule->command(PruneTelescopeEntriesCommand::class)
->withoutOverlapping()
-2
View File
@@ -5,7 +5,6 @@ declare(strict_types=1);
namespace App\Http\Controllers;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Routing\Controller as BaseController;
@@ -15,6 +14,5 @@ use Illuminate\Routing\Controller as BaseController;
class Controller extends BaseController
{
use AuthorizesRequests;
use DispatchesJobs;
use ValidatesRequests;
}
+3 -3
View File
@@ -84,13 +84,13 @@ class Kernel extends HttpKernel
];
/**
* The application's route middleware.
* The application's middleware aliases.
*
* These middleware may be assigned to groups or used individually.
* Aliases may be used instead of class names to conveniently assign middleware to routes and groups.
*
* @var array<string, class-string|string>
*/
protected $routeMiddleware = [
protected $middlewareAliases = [
'auth' => Authenticate::class,
'auth.basic' => AuthenticateWithBasicAuth::class,
'auth.session' => AuthenticateSession::class,
+4 -6
View File
@@ -21,12 +21,10 @@ class Authenticate extends Middleware
*
* @noinspection PhpMissingParentCallCommonInspection
*/
protected function redirectTo($request): ?string
protected function redirectTo(Request $request): ?string
{
if (! $request->expectsJson()) {
return url(Config::get('wiki.login'));
}
return null;
return $request->expectsJson()
? null
: url(Config::get('wiki.login'));
}
}
@@ -25,7 +25,7 @@ class RedirectIfAuthenticated
* @param string|null ...$guards
* @return JsonResponse|Response|RedirectResponse
*/
public function handle(Request $request, Closure $next, ...$guards): JsonResponse|Response|RedirectResponse
public function handle(Request $request, Closure $next, ?string ...$guards): JsonResponse|Response|RedirectResponse
{
$guards = empty($guards) ? [null] : $guards;
+9 -19
View File
@@ -31,7 +31,15 @@ class RouteServiceProvider extends ServiceProvider
*/
public function boot(): void
{
$this->configureRateLimiting();
RateLimiter::for('api', function (Request $request) {
// Allow the client to bypass API rate limiting
$user = $request->user('sanctum');
if ($user instanceof User && $user->can(SpecialPermission::BYPASS_API_RATE_LIMITER)) {
return Limit::none();
}
return Limit::perMinute(90)->by(Auth::check() ? Auth::id() : $request->ip());
});
$this->routes(function () {
Route::middleware('web')
@@ -66,22 +74,4 @@ class RouteServiceProvider extends ServiceProvider
->group(base_path('routes/api.php'));
});
}
/**
* Configure the rate limiters for the application.
*
* @return void
*/
protected function configureRateLimiting(): void
{
RateLimiter::for('api', function (Request $request) {
// Allow the client to bypass API rate limiting
$user = $request->user('sanctum');
if ($user instanceof User && $user->can(SpecialPermission::BYPASS_API_RATE_LIMITER)) {
return Limit::none();
}
return Limit::perMinute(90)->by(Auth::check() ? Auth::id() : $request->ip());
});
}
}
+2 -6
View File
@@ -55,16 +55,12 @@ abstract class SubmissionRule implements DataAwareRule, Rule, ValidatorAwareRule
$ffprobeData = Arr::get($validator->getData(), 'ffprobeData');
if ($ffprobeData === null && $file !== null) {
$data = array_merge($validator->getData(), ['ffprobeData' => $this->getFFprobeData($file)]);
$validator->setData($data);
$validator->setValue('ffprobeData', $this->getFFprobeData($file));
}
$loudnessStats = Arr::get($validator->getData(), 'loudnessStats');
if ($loudnessStats === null && $file !== null) {
$data = array_merge($validator->getData(), ['loudnessStats' => $this->getLoudnessStats($file)]);
$validator->setData($data);
$validator->setValue('loudnessStats', $this->getLoudnessStats($file));
}
return $this;
+9 -9
View File
@@ -33,12 +33,12 @@
"babenkoivan/elastic-scout-driver-plus": "^4.3",
"bensampo/laravel-enum": "^6.3",
"bepsvpt/secure-headers": "^7.4",
"cyrildewit/eloquent-viewable": "^6.1",
"cyrildewit/eloquent-viewable": "^7.0",
"fakerphp/faker": "^1.21",
"guzzlehttp/guzzle": "^7.5",
"laravel-notification-channels/discord": "^1.4",
"laravel/fortify": "^1.16",
"laravel/framework": "^9.45",
"laravel/framework": "^10.7",
"laravel/horizon": "^5.12",
"laravel/nova": "^4.22.2",
"laravel/sanctum": "^3.2",
@@ -50,21 +50,21 @@
"propaganistas/laravel-disposable-email": "^2.2",
"spatie/db-dumper": "^3.1.1",
"spatie/laravel-permission": "^5.8",
"staudenmeir/belongs-to-through": "^2.12",
"staudenmeir/laravel-adjacency-list": "^1.12",
"staudenmeir/belongs-to-through": "^2.13",
"staudenmeir/laravel-adjacency-list": "^1.13",
"symfony/http-client": "^6.0",
"symfony/mailgun-mailer": "^6.0",
"vinkla/hashids": "^10.0"
"vinkla/hashids": "^11.0"
},
"require-dev": {
"brianium/paratest": "^6.7",
"brianium/paratest": "^7.0",
"laravel/pint": "^1.6",
"mockery/mockery": "^1.5.1",
"nunomaduro/collision": "^6.1",
"nunomaduro/collision": "^7.0",
"nunomaduro/larastan": "^2.4",
"phpunit/phpunit": "^9.5.10",
"phpunit/phpunit": "^10.1",
"predis/predis": "^2.0",
"spatie/laravel-ignition": "^1.6"
"spatie/laravel-ignition": "^2.0"
},
"config": {
"optimize-autoloader": true,
Generated
+764 -875
View File
File diff suppressed because it is too large Load Diff
+4 -26
View File
@@ -3,6 +3,7 @@
declare(strict_types=1);
use Illuminate\Support\Facades\Facade;
use Illuminate\Support\ServiceProvider;
return [
@@ -209,33 +210,10 @@ return [
|
*/
'providers' => [
'providers' => ServiceProvider::defaultProviders()->merge([
/*
* Laravel Framework Service Providers...
* Package Service Providers...
*/
Illuminate\Auth\AuthServiceProvider::class,
Illuminate\Broadcasting\BroadcastServiceProvider::class,
Illuminate\Bus\BusServiceProvider::class,
Illuminate\Cache\CacheServiceProvider::class,
Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class,
Illuminate\Cookie\CookieServiceProvider::class,
Illuminate\Database\DatabaseServiceProvider::class,
Illuminate\Encryption\EncryptionServiceProvider::class,
Illuminate\Filesystem\FilesystemServiceProvider::class,
Illuminate\Foundation\Providers\FoundationServiceProvider::class,
Illuminate\Hashing\HashServiceProvider::class,
Illuminate\Mail\MailServiceProvider::class,
Illuminate\Notifications\NotificationServiceProvider::class,
Illuminate\Pagination\PaginationServiceProvider::class,
Illuminate\Pipeline\PipelineServiceProvider::class,
Illuminate\Queue\QueueServiceProvider::class,
Illuminate\Redis\RedisServiceProvider::class,
Illuminate\Auth\Passwords\PasswordResetServiceProvider::class,
Illuminate\Session\SessionServiceProvider::class,
Illuminate\Translation\TranslationServiceProvider::class,
Illuminate\Validation\ValidationServiceProvider::class,
Illuminate\View\ViewServiceProvider::class,
/*
* Application Service Providers...
@@ -248,7 +226,7 @@ return [
App\Providers\NovaServiceProvider::class,
App\Providers\RouteServiceProvider::class,
App\Providers\TelescopeServiceProvider::class,
],
])->toArray(),
/*
|--------------------------------------------------------------------------
+2 -2
View File
@@ -88,7 +88,7 @@ return [
| than one user table or model in the application and you want to have
| separate password reset settings based on the specific user types.
|
| The expire time is the number of minutes that each reset token will be
| The expiry time is the number of minutes that each reset token will be
| considered valid. This security feature keeps tokens short-lived so
| they have less time to be guessed. You may change this as needed.
|
@@ -97,7 +97,7 @@ return [
'passwords' => [
'users' => [
'provider' => 'users',
'table' => 'password_resets',
'table' => 'password_reset_tokens',
'expire' => 60,
'throttle' => 60,
],
+24
View File
@@ -123,6 +123,30 @@ return [
'views' => false,
'paths' => [
'login' => null,
'logout' => null,
'password.request' => null,
'password.reset' => null,
'password.email' => null,
'password.update' => null,
'register' => null,
'verification.notice' => null,
'verification.verify' => null,
'verification.send' => null,
'user-profile-information.update' => null,
'user-password.update' => null,
'password.confirm' => null,
'password.confirmation' => null,
'two-factor.login' => null,
'two-factor.enable' => null,
'two-factor.confirm' => null,
'two-factor.disable' => null,
'two-factor.qr-code' => null,
'two-factor.secret-key' => null,
'two-factor.recovery-codes' => null,
],
'redirects' => [
'login' => null,
'logout' => env('FORTIFY_URL').env('FORTIFY_PATH').'/login',
+9
View File
@@ -5,6 +5,7 @@ declare(strict_types=1);
use Monolog\Handler\NullHandler;
use Monolog\Handler\StreamHandler;
use Monolog\Handler\SyslogUdpHandler;
use Monolog\Processor\PsrLogMessageProcessor;
return [
@@ -63,6 +64,7 @@ return [
'driver' => 'single',
'path' => storage_path('logs/laravel.log'),
'level' => env('LOG_LEVEL', 'debug'),
'replace_placeholders' => true,
],
'daily' => [
@@ -70,6 +72,7 @@ return [
'path' => storage_path('logs/laravel.log'),
'level' => env('LOG_LEVEL', 'debug'),
'days' => 3,
'replace_placeholders' => true,
],
'slack' => [
@@ -78,6 +81,7 @@ return [
'username' => 'Laravel Log',
'emoji' => ':boom:',
'level' => env('LOG_LEVEL', 'critical'),
'replace_placeholders' => true,
],
'papertrail' => [
@@ -89,6 +93,7 @@ return [
'port' => env('PAPERTRAIL_PORT'),
'connectionString' => 'tls://'.env('PAPERTRAIL_URL').':'.env('PAPERTRAIL_PORT'),
],
'processors' => [PsrLogMessageProcessor::class],
],
'stderr' => [
@@ -99,16 +104,20 @@ return [
'with' => [
'stream' => 'php://stderr',
],
'processors' => [PsrLogMessageProcessor::class],
],
'syslog' => [
'driver' => 'syslog',
'level' => env('LOG_LEVEL', 'debug'),
'facility' => LOG_USER,
'replace_placeholders' => true,
],
'errorlog' => [
'driver' => 'errorlog',
'level' => env('LOG_LEVEL', 'debug'),
'replace_placeholders' => true,
],
'null' => [
+7 -1
View File
@@ -30,7 +30,7 @@ return [
| sending an e-mail. You will specify which one you are using for your
| mailers below. You are free to add additional mailers as required.
|
| Supported: "smtp", "sendmail", "mailgun", "ses",
| Supported: "smtp", "sendmail", "mailgun", "ses", "ses-v2",
| "postmark", "log", "array", "failover"
|
*/
@@ -53,10 +53,16 @@ return [
'mailgun' => [
'transport' => 'mailgun',
// 'client' => [
// 'timeout' => 5,
// ],
],
'postmark' => [
'transport' => 'postmark',
// 'client' => [
// 'timeout' => 5,
// ],
],
'sendmail' => [
+16
View File
@@ -75,6 +75,22 @@ return [
],
/*
|--------------------------------------------------------------------------
| Job Batching
|--------------------------------------------------------------------------
|
| The following options configure the database and table that store job
| batching information. These options can be updated to any database
| connection and table which has been defined by your application.
|
*/
'batching' => [
'database' => env('DB_CONNECTION', 'mysql'),
'table' => 'job_batches',
],
/*
|--------------------------------------------------------------------------
| Failed Queue Jobs
@@ -15,8 +15,8 @@ return new class extends Migration
*/
public function up(): void
{
if (! Schema::hasTable('password_resets')) {
Schema::create('password_resets', function (Blueprint $table) {
if (! Schema::hasTable('password_reset_tokens')) {
Schema::create('password_reset_tokens', function (Blueprint $table) {
$table->string('email')->primary();
$table->string('token');
$table->timestamp('created_at')->nullable();
@@ -31,6 +31,6 @@ return new class extends Migration
*/
public function down(): void
{
Schema::dropIfExists('password_resets');
Schema::dropIfExists('password_reset_tokens');
}
};
-3
View File
@@ -22,9 +22,6 @@ parameters:
- '#Strict comparison using === between class-string<Laravel\\Nova\\Resource> and null will always evaluate to false.#'
- '#Call to an undefined method ProtoneMedia\\LaravelFFMpeg\\Drivers\\PHPFFMpeg::export\(\).#'
- '#Call to an undefined method ProtoneMedia\\LaravelFFMpeg\\Drivers\\PHPFFMpeg::getProcessOutput\(\).#'
-
message: '#Unreachable statement - code above always terminates.#'
path: app/Http/Middleware/ThrottleRequestsWithService.php
-
message: '#Method App\\Rules\\Wiki\\Submission\\SubmissionRule::#'
path: app/Rules/Wiki/Submission/SubmissionRule.php
+5
View File
@@ -12,6 +12,11 @@
<directory suffix="Test.php">./tests/Feature</directory>
</testsuite>
</testsuites>
<source>
<include>
<directory suffix=".php">./app</directory>
</include>
</source>
<php>
<env name="APP_ENV" value="testing"/>
<env name="BCRYPT_ROUNDS" value="4"/>
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1,5 +1,5 @@
{
"/app.js": "/app.js?id=04e348094a54ac4cf95cdaa45acb8f58",
"/app.js": "/app.js?id=15f779f55ed22d2516dfe65be8fad3ef",
"/manifest.js": "/manifest.js?id=d75058ce2144a4049857d3ff9e02de1e",
"/app.css": "/app.css?id=30653583355cfd55b0fd95f328ff4706",
"/vendor.js": "/vendor.js?id=de86bde8857e857b607852d11627d8e4",
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1,5 +1,5 @@
{
"/app.js": "/app.js?id=a8713c727883a44917711340bf6c817a",
"/app.js": "/app.js?id=65e09ad17337bc012e95e6a52546ec50",
"/app-dark.css": "/app-dark.css?id=b44bf369e5d39f6861be639ef866bf5a",
"/app.css": "/app.css?id=41c5661581f2614180d6d33c17470f08"
}
+2 -2
View File
@@ -54,8 +54,8 @@ use Illuminate\Support\Str;
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
| routes are loaded by the RouteServiceProvider and all of them will
| be assigned to the "api" middleware group. Make something great!
|
*/
+2 -2
View File
@@ -8,7 +8,7 @@ declare(strict_types=1);
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
| routes are loaded by the RouteServiceProvider and all of them will
| be assigned to the "web" middleware group. Make something great!
|
*/
@@ -9,7 +9,6 @@ use App\Constants\Config\ValidationConstants;
use App\Enums\Rules\ModerationService;
use App\Models\Auth\User;
use Illuminate\Foundation\Testing\WithFaker;
use Illuminate\Foundation\Testing\WithoutEvents;
use Illuminate\Support\Facades\Config;
use Illuminate\Support\Facades\Http;
use Illuminate\Validation\ValidationException;
@@ -23,7 +22,6 @@ use Tests\TestCase;
class CreateNewUserTest extends TestCase
{
use WithFaker;
use WithoutEvents;
/**
* The Create New User Action shall require the name, email, password & terms fields.
@@ -10,7 +10,6 @@ use App\Enums\Rules\ModerationService;
use App\Models\Auth\User;
use Illuminate\Auth\Notifications\VerifyEmail;
use Illuminate\Foundation\Testing\WithFaker;
use Illuminate\Foundation\Testing\WithoutEvents;
use Illuminate\Support\Facades\Config;
use Illuminate\Support\Facades\Http;
use Illuminate\Support\Facades\Notification;
@@ -25,7 +24,6 @@ use Tests\TestCase;
class UpdateUserProfileInformationTest extends TestCase
{
use WithFaker;
use WithoutEvents;
/**
* The Update User Profile Information Action shall require the name, email, password & terms fields.
@@ -10,7 +10,6 @@ use App\Models\List\Playlist\PlaylistTrack;
use App\Models\Wiki\Video;
use Exception;
use Illuminate\Foundation\Testing\WithFaker;
use Illuminate\Foundation\Testing\WithoutEvents;
use Tests\TestCase;
/**
@@ -19,7 +18,6 @@ use Tests\TestCase;
class InsertTrackAfterTest extends TestCase
{
use WithFaker;
use WithoutEvents;
/**
* The Insert Track After Action shall set the track as the playlist's last track if inserting after the last track.
@@ -10,7 +10,6 @@ use App\Models\List\Playlist\PlaylistTrack;
use App\Models\Wiki\Video;
use Exception;
use Illuminate\Foundation\Testing\WithFaker;
use Illuminate\Foundation\Testing\WithoutEvents;
use Tests\TestCase;
/**
@@ -19,7 +18,6 @@ use Tests\TestCase;
class InsertTrackBeforeTest extends TestCase
{
use WithFaker;
use WithoutEvents;
/**
* The Insert Track Before Action shall set the track as the playlist's first track if inserting before the first track.
@@ -9,7 +9,6 @@ use App\Models\List\Playlist;
use App\Models\List\Playlist\PlaylistTrack;
use App\Models\Wiki\Video;
use Exception;
use Illuminate\Foundation\Testing\WithoutEvents;
use Tests\TestCase;
/**
@@ -17,8 +16,6 @@ use Tests\TestCase;
*/
class InsertTrackTest extends TestCase
{
use WithoutEvents;
/**
* The Insert Track Action shall set the first inserted track as first and last.
*
@@ -8,7 +8,6 @@ use App\Actions\Models\List\Playlist\RemoveTrackAction;
use App\Models\List\Playlist;
use Exception;
use Illuminate\Foundation\Testing\WithFaker;
use Illuminate\Foundation\Testing\WithoutEvents;
use Tests\TestCase;
/**
@@ -17,7 +16,6 @@ use Tests\TestCase;
class RemoveTrackTest extends TestCase
{
use WithFaker;
use WithoutEvents;
/**
* The Remove Track Action shall remove the sole track.
@@ -11,8 +11,8 @@ use App\Enums\Models\Wiki\ResourceSite;
use App\Models\Wiki\Anime;
use App\Models\Wiki\ExternalResource;
use App\Models\Wiki\Image;
use Exception;
use Illuminate\Foundation\Testing\WithFaker;
use Illuminate\Http\Client\RequestException;
use Illuminate\Http\Testing\File;
use Illuminate\Support\Facades\Config;
use Illuminate\Support\Facades\Http;
@@ -31,12 +31,10 @@ class BackfillLargeCoverImageTest extends TestCase
*
* @return void
*
* @throws RequestException
* @throws Exception
*/
public function testSkipped(): void
{
Http::fake();
Storage::fake(Config::get('image.disk'));
$image = Image::factory()->createOne([
@@ -62,12 +60,10 @@ class BackfillLargeCoverImageTest extends TestCase
*
* @return void
*
* @throws RequestException
* @throws Exception
*/
public function testFailedWhenNoResource(): void
{
Http::fake();
Storage::fake(Config::get('image.disk'));
$anime = Anime::factory()->createOne();
@@ -87,12 +83,10 @@ class BackfillLargeCoverImageTest extends TestCase
*
* @return void
*
* @throws RequestException
* @throws Exception
*/
public function testFailedWhenNoAnilistResource(): void
{
Http::fake();
Storage::fake(Config::get('image.disk'));
$site = null;
@@ -127,7 +121,7 @@ class BackfillLargeCoverImageTest extends TestCase
*
* @return void
*
* @throws RequestException
* @throws Exception
*/
public function testFailedWhenBadAnilistResponse(): void
{
@@ -162,7 +156,7 @@ class BackfillLargeCoverImageTest extends TestCase
*
* @return void
*
* @throws RequestException
* @throws Exception
*/
public function testPassed(): void
{
@@ -11,8 +11,8 @@ use App\Enums\Models\Wiki\ResourceSite;
use App\Models\Wiki\Anime;
use App\Models\Wiki\ExternalResource;
use App\Models\Wiki\Image;
use Exception;
use Illuminate\Foundation\Testing\WithFaker;
use Illuminate\Http\Client\RequestException;
use Illuminate\Http\Testing\File;
use Illuminate\Support\Facades\Config;
use Illuminate\Support\Facades\Http;
@@ -31,12 +31,10 @@ class BackfillSmallCoverImageTest extends TestCase
*
* @return void
*
* @throws RequestException
* @throws Exception
*/
public function testSkipped(): void
{
Http::fake();
Storage::fake(Config::get('image.disk'));
$image = Image::factory()->createOne([
@@ -62,12 +60,10 @@ class BackfillSmallCoverImageTest extends TestCase
*
* @return void
*
* @throws RequestException
* @throws Exception
*/
public function testFailedWhenNoResource(): void
{
Http::fake();
Storage::fake(Config::get('image.disk'));
$anime = Anime::factory()->createOne();
@@ -87,12 +83,10 @@ class BackfillSmallCoverImageTest extends TestCase
*
* @return void
*
* @throws RequestException
* @throws Exception
*/
public function testFailedWhenNoAnilistResource(): void
{
Http::fake();
Storage::fake(Config::get('image.disk'));
$site = null;
@@ -127,7 +121,7 @@ class BackfillSmallCoverImageTest extends TestCase
*
* @return void
*
* @throws RequestException
* @throws Exception
*/
public function testFailedWhenBadAnilistResponse(): void
{
@@ -162,7 +156,7 @@ class BackfillSmallCoverImageTest extends TestCase
*
* @return void
*
* @throws RequestException
* @throws Exception
*/
public function testPassed(): void
{
@@ -9,8 +9,8 @@ use App\Enums\Actions\ActionStatus;
use App\Enums\Models\Wiki\ResourceSite;
use App\Models\Wiki\Anime;
use App\Models\Wiki\ExternalResource;
use Exception;
use Illuminate\Foundation\Testing\WithFaker;
use Illuminate\Http\Client\RequestException;
use Illuminate\Support\Arr;
use Illuminate\Support\Facades\Http;
use Tests\TestCase;
@@ -27,12 +27,10 @@ class BackfillAnidbResourceTest extends TestCase
*
* @return void
*
* @throws RequestException
* @throws Exception
*/
public function testSkipped(): void
{
Http::fake();
$resource = ExternalResource::factory()->createOne([
ExternalResource::ATTRIBUTE_SITE => ResourceSite::ANIDB,
]);
@@ -55,12 +53,10 @@ class BackfillAnidbResourceTest extends TestCase
*
* @return void
*
* @throws RequestException
* @throws Exception
*/
public function testFailedWhenNoResource(): void
{
Http::fake();
$anime = Anime::factory()->createOne();
$action = new BackfillAnidbResourceAction($anime);
@@ -77,7 +73,7 @@ class BackfillAnidbResourceTest extends TestCase
*
* @return void
*
* @throws RequestException
* @throws Exception
*/
public function testFailedWhenNoMatch(): void
{
@@ -113,7 +109,7 @@ class BackfillAnidbResourceTest extends TestCase
*
* @return void
*
* @throws RequestException
* @throws Exception
*/
public function testPassed(): void
{
@@ -152,7 +148,7 @@ class BackfillAnidbResourceTest extends TestCase
*
* @return void
*
* @throws RequestException
* @throws Exception
*/
public function testGetsExistingResource(): void
{
@@ -9,8 +9,8 @@ use App\Enums\Actions\ActionStatus;
use App\Enums\Models\Wiki\ResourceSite;
use App\Models\Wiki\Anime;
use App\Models\Wiki\ExternalResource;
use Exception;
use Illuminate\Foundation\Testing\WithFaker;
use Illuminate\Http\Client\RequestException;
use Illuminate\Support\Arr;
use Illuminate\Support\Facades\Http;
use Tests\TestCase;
@@ -27,12 +27,10 @@ class BackfillAnilistResourceTest extends TestCase
*
* @return void
*
* @throws RequestException
* @throws Exception
*/
public function testSkipped(): void
{
Http::fake();
$resource = ExternalResource::factory()->createOne([
ExternalResource::ATTRIBUTE_SITE => ResourceSite::ANILIST,
]);
@@ -55,12 +53,10 @@ class BackfillAnilistResourceTest extends TestCase
*
* @return void
*
* @throws RequestException
* @throws Exception
*/
public function testFailedWhenNoResource(): void
{
Http::fake();
$anime = Anime::factory()->createOne();
$action = new BackfillAnilistResourceAction($anime);
@@ -77,7 +73,7 @@ class BackfillAnilistResourceTest extends TestCase
*
* @return void
*
* @throws RequestException
* @throws Exception
*/
public function testFailedWhenNoMalMatch(): void
{
@@ -109,7 +105,7 @@ class BackfillAnilistResourceTest extends TestCase
*
* @return void
*
* @throws RequestException
* @throws Exception
*/
public function testMalPassed(): void
{
@@ -146,7 +142,7 @@ class BackfillAnilistResourceTest extends TestCase
*
* @return void
*
* @throws RequestException
* @throws Exception
*/
public function testFailedWhenNoKitsuMatch(): void
{
@@ -178,7 +174,7 @@ class BackfillAnilistResourceTest extends TestCase
*
* @return void
*
* @throws RequestException
* @throws Exception
*/
public function testKitsuPassed(): void
{
@@ -222,7 +218,7 @@ class BackfillAnilistResourceTest extends TestCase
*
* @return void
*
* @throws RequestException
* @throws Exception
*/
public function testFailedWhenNoAnidbMatch(): void
{
@@ -252,7 +248,7 @@ class BackfillAnilistResourceTest extends TestCase
*
* @return void
*
* @throws RequestException
* @throws Exception
*/
public function testAnidbPassed(): void
{
@@ -285,7 +281,7 @@ class BackfillAnilistResourceTest extends TestCase
*
* @return void
*
* @throws RequestException
* @throws Exception
*/
public function testGetsExistingResource(): void
{
@@ -9,8 +9,8 @@ use App\Enums\Actions\ActionStatus;
use App\Enums\Models\Wiki\ResourceSite;
use App\Models\Wiki\Anime;
use App\Models\Wiki\ExternalResource;
use Exception;
use Illuminate\Foundation\Testing\WithFaker;
use Illuminate\Http\Client\RequestException;
use Illuminate\Support\Facades\Http;
use Tests\TestCase;
@@ -26,12 +26,10 @@ class BackfillAnnResourceTest extends TestCase
*
* @return void
*
* @throws RequestException
* @throws Exception
*/
public function testSkipped(): void
{
Http::fake();
$resource = ExternalResource::factory()->createOne([
ExternalResource::ATTRIBUTE_SITE => ResourceSite::ANN,
]);
@@ -54,12 +52,10 @@ class BackfillAnnResourceTest extends TestCase
*
* @return void
*
* @throws RequestException
* @throws Exception
*/
public function testFailedWhenNoResource(): void
{
Http::fake();
$anime = Anime::factory()->createOne();
$action = new BackfillAnnResourceAction($anime);
@@ -76,7 +72,7 @@ class BackfillAnnResourceTest extends TestCase
*
* @return void
*
* @throws RequestException
* @throws Exception
*/
public function testFailedWhenNoKitsuMatch(): void
{
@@ -108,7 +104,7 @@ class BackfillAnnResourceTest extends TestCase
*
* @return void
*
* @throws RequestException
* @throws Exception
*/
public function testKitsuPassed(): void
{
@@ -152,7 +148,7 @@ class BackfillAnnResourceTest extends TestCase
*
* @return void
*
* @throws RequestException
* @throws Exception
*/
public function testGetsExistingResource(): void
{
@@ -9,8 +9,8 @@ use App\Enums\Actions\ActionStatus;
use App\Enums\Models\Wiki\ResourceSite;
use App\Models\Wiki\Anime;
use App\Models\Wiki\ExternalResource;
use Exception;
use Illuminate\Foundation\Testing\WithFaker;
use Illuminate\Http\Client\RequestException;
use Illuminate\Support\Arr;
use Illuminate\Support\Facades\Http;
use Tests\TestCase;
@@ -27,12 +27,10 @@ class BackfillKitsuResourceTest extends TestCase
*
* @return void
*
* @throws RequestException
* @throws Exception
*/
public function testSkipped(): void
{
Http::fake();
$resource = ExternalResource::factory()->createOne([
ExternalResource::ATTRIBUTE_SITE => ResourceSite::KITSU,
]);
@@ -55,12 +53,10 @@ class BackfillKitsuResourceTest extends TestCase
*
* @return void
*
* @throws RequestException
* @throws Exception
*/
public function testFailedWhenNoResource(): void
{
Http::fake();
$anime = Anime::factory()->createOne();
$action = new BackfillKitsuResourceAction($anime);
@@ -78,7 +74,7 @@ class BackfillKitsuResourceTest extends TestCase
*
* @return void
*
* @throws RequestException
* @throws Exception
*/
public function testFailedWhenNoMatch(): void
{
@@ -117,7 +113,7 @@ class BackfillKitsuResourceTest extends TestCase
*
* @return void
*
* @throws RequestException
* @throws Exception
*/
public function testPassed(): void
{
@@ -162,7 +158,7 @@ class BackfillKitsuResourceTest extends TestCase
*
* @return void
*
* @throws RequestException
* @throws Exception
*/
public function testGetsExistingResource(): void
{
@@ -9,8 +9,8 @@ use App\Enums\Actions\ActionStatus;
use App\Enums\Models\Wiki\ResourceSite;
use App\Models\Wiki\Anime;
use App\Models\Wiki\ExternalResource;
use Exception;
use Illuminate\Foundation\Testing\WithFaker;
use Illuminate\Http\Client\RequestException;
use Illuminate\Support\Arr;
use Illuminate\Support\Facades\Http;
use Tests\TestCase;
@@ -27,12 +27,10 @@ class BackfillMalResourceTest extends TestCase
*
* @return void
*
* @throws RequestException
* @throws Exception
*/
public function testSkipped(): void
{
Http::fake();
$resource = ExternalResource::factory()->createOne([
ExternalResource::ATTRIBUTE_SITE => ResourceSite::MAL,
]);
@@ -55,12 +53,10 @@ class BackfillMalResourceTest extends TestCase
*
* @return void
*
* @throws RequestException
* @throws Exception
*/
public function testFailedWhenNoResource(): void
{
Http::fake();
$anime = Anime::factory()->createOne();
$action = new BackfillMalResourceAction($anime);
@@ -77,7 +73,7 @@ class BackfillMalResourceTest extends TestCase
*
* @return void
*
* @throws RequestException
* @throws Exception
*/
public function testFailedWhenNoKitsuMatch(): void
{
@@ -109,7 +105,7 @@ class BackfillMalResourceTest extends TestCase
*
* @return void
*
* @throws RequestException
* @throws Exception
*/
public function testKitsuPassed(): void
{
@@ -153,7 +149,7 @@ class BackfillMalResourceTest extends TestCase
*
* @return void
*
* @throws RequestException
* @throws Exception
*/
public function testFailedWhenNoAnilistMatch(): void
{
@@ -185,7 +181,7 @@ class BackfillMalResourceTest extends TestCase
*
* @return void
*
* @throws RequestException
* @throws Exception
*/
public function testAnilistPassed(): void
{
@@ -222,7 +218,7 @@ class BackfillMalResourceTest extends TestCase
*
* @return void
*
* @throws RequestException
* @throws Exception
*/
public function testFailedWhenNoAnidbMatch(): void
{
@@ -252,7 +248,7 @@ class BackfillMalResourceTest extends TestCase
*
* @return void
*
* @throws RequestException
* @throws Exception
*/
public function testAnidbPassed(): void
{
@@ -285,7 +281,7 @@ class BackfillMalResourceTest extends TestCase
*
* @return void
*
* @throws RequestException
* @throws Exception
*/
public function testGetsExistingResource(): void
{
@@ -10,8 +10,8 @@ use App\Enums\Models\Wiki\ResourceSite;
use App\Models\Wiki\Anime;
use App\Models\Wiki\ExternalResource;
use App\Models\Wiki\Studio;
use Exception;
use Illuminate\Foundation\Testing\WithFaker;
use Illuminate\Http\Client\RequestException;
use Illuminate\Support\Arr;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Http;
@@ -30,12 +30,10 @@ class BackfillAnimeStudiosTest extends TestCase
*
* @return void
*
* @throws RequestException
* @throws Exception
*/
public function testSkipped(): void
{
Http::fake();
$studiosCount = $this->faker->randomDigitNotNull();
$anime = Anime::factory()
@@ -56,12 +54,10 @@ class BackfillAnimeStudiosTest extends TestCase
*
* @return void
*
* @throws RequestException
* @throws Exception
*/
public function testFailedWhenNoResource(): void
{
Http::fake();
$anime = Anime::factory()->createOne();
$action = new BackfillAnimeStudiosAction($anime);
@@ -78,7 +74,7 @@ class BackfillAnimeStudiosTest extends TestCase
*
* @return void
*
* @throws RequestException
* @throws Exception
*/
public function testFailedWhenNoMalMatch(): void
{
@@ -110,7 +106,7 @@ class BackfillAnimeStudiosTest extends TestCase
*
* @return void
*
* @throws RequestException
* @throws Exception
*/
public function testMalPassed(): void
{
@@ -150,7 +146,7 @@ class BackfillAnimeStudiosTest extends TestCase
*
* @return void
*
* @throws RequestException
* @throws Exception
*/
public function testFailedWhenNoAnilistMatch(): void
{
@@ -182,7 +178,7 @@ class BackfillAnimeStudiosTest extends TestCase
*
* @return void
*
* @throws RequestException
* @throws Exception
*/
public function testAnilistPassed(): void
{
@@ -228,7 +224,7 @@ class BackfillAnimeStudiosTest extends TestCase
*
* @return void
*
* @throws RequestException
* @throws Exception
*/
public function testFailedWhenNoKitsuMatch(): void
{
@@ -260,7 +256,7 @@ class BackfillAnimeStudiosTest extends TestCase
*
* @return void
*
* @throws RequestException
* @throws Exception
*/
public function testKitsuPassed(): void
{
@@ -311,7 +307,7 @@ class BackfillAnimeStudiosTest extends TestCase
*
* @return void
*
* @throws RequestException
* @throws Exception
*/
public function testCreatesStudioResource(): void
{
@@ -364,7 +360,7 @@ class BackfillAnimeStudiosTest extends TestCase
*
* @return void
*
* @throws RequestException
* @throws Exception
*/
public function testGetsExistingResource(): void
{
@@ -11,8 +11,8 @@ use App\Enums\Models\Wiki\ResourceSite;
use App\Models\Wiki\ExternalResource;
use App\Models\Wiki\Image;
use App\Models\Wiki\Studio;
use Exception;
use Illuminate\Foundation\Testing\WithFaker;
use Illuminate\Http\Client\RequestException;
use Illuminate\Http\Testing\File;
use Illuminate\Support\Facades\Config;
use Illuminate\Support\Facades\Http;
@@ -31,12 +31,10 @@ class BackfillLargeCoverImageTest extends TestCase
*
* @return void
*
* @throws RequestException
* @throws Exception
*/
public function testSkipped(): void
{
Http::fake();
Storage::fake(Config::get('image.disk'));
$image = Image::factory()->createOne([
@@ -62,12 +60,10 @@ class BackfillLargeCoverImageTest extends TestCase
*
* @return void
*
* @throws RequestException
* @throws Exception
*/
public function testFailedWhenNoResource(): void
{
Http::fake();
Storage::fake(Config::get('image.disk'));
$studio = Studio::factory()->createOne();
@@ -87,12 +83,10 @@ class BackfillLargeCoverImageTest extends TestCase
*
* @return void
*
* @throws RequestException
* @throws Exception
*/
public function testFailedWhenNoMalResource(): void
{
Http::fake();
Storage::fake(Config::get('image.disk'));
$site = null;
@@ -127,7 +121,7 @@ class BackfillLargeCoverImageTest extends TestCase
*
* @return void
*
* @throws RequestException
* @throws Exception
*/
public function testPassed(): void
{
@@ -14,6 +14,7 @@ use App\Models\Wiki\Anime\AnimeTheme;
use App\Models\Wiki\Anime\Theme\AnimeThemeEntry;
use App\Models\Wiki\Audio;
use App\Models\Wiki\Video;
use Exception;
use Illuminate\Foundation\Testing\WithFaker;
use Illuminate\Support\Facades\Config;
use Illuminate\Support\Facades\Storage;
@@ -31,6 +32,8 @@ class BackfillVideoAudioTest extends TestCase
* The Backfill Audio Action shall skip the Anime if the relation already exists.
*
* @return void
*
* @throws Exception
*/
public function testSkipped(): void
{
@@ -54,6 +57,8 @@ class BackfillVideoAudioTest extends TestCase
* The Backfill Audio Action shall fail if the Video is not attached to any Entries.
*
* @return void
*
* @throws Exception
*/
public function testFailedWhenNoEntries(): void
{
@@ -75,6 +80,8 @@ class BackfillVideoAudioTest extends TestCase
* The Backfill Audio Action shall pass if the Video is a source.
*
* @return void
*
* @throws Exception
*/
public function testPassesSourceVideo(): void
{
@@ -105,6 +112,8 @@ class BackfillVideoAudioTest extends TestCase
* The Backfill Audio Action shall pass if the Video has a higher priority source.
*
* @return void
*
* @throws Exception
*/
public function testPassesWithHigherPrioritySource(): void
{
@@ -140,6 +149,8 @@ class BackfillVideoAudioTest extends TestCase
* The Backfill Audio Action shall pass if the Video has a primary version source.
*
* @return void
*
* @throws Exception
*/
public function testPassesWithPrimaryVersionSource(): void
{
@@ -8,6 +8,7 @@ use App\Actions\Storage\Admin\Dump\DumpDocumentAction;
use App\Constants\Config\DumpConstants;
use App\Enums\Actions\ActionStatus;
use App\Models\Admin\Dump;
use Exception;
use Illuminate\Foundation\Testing\WithFaker;
use Illuminate\Support\Facades\Config;
use Illuminate\Support\Facades\Date;
@@ -25,6 +26,8 @@ class DumpDocumentTest extends TestCase
* The Database Dump Command shall output "Database dump '{dumpFile}' has been created".
*
* @return void
*
* @throws Exception
*/
public function testDataBaseDumpOutput(): void
{
@@ -8,6 +8,7 @@ use App\Actions\Storage\Admin\Dump\DumpWikiAction;
use App\Constants\Config\DumpConstants;
use App\Enums\Actions\ActionStatus;
use App\Models\Admin\Dump;
use Exception;
use Illuminate\Foundation\Testing\WithFaker;
use Illuminate\Support\Facades\Config;
use Illuminate\Support\Facades\Date;
@@ -25,6 +26,8 @@ class DumpWikiTest extends TestCase
* The Database Dump Command shall output "Database dump '{dumpFile}' has been created".
*
* @return void
*
* @throws Exception
*/
public function testDataBaseDumpOutput(): void
{
@@ -9,6 +9,7 @@ use App\Actions\Storage\Admin\Dump\PruneDumpAction;
use App\Constants\Config\DumpConstants;
use App\Enums\Actions\ActionStatus;
use App\Models\Admin\Dump;
use Exception;
use Illuminate\Foundation\Testing\WithFaker;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Config;
@@ -27,6 +28,8 @@ class PruneDumpTest extends TestCase
* If no changes are needed, the Prune Dumps Action shall fail.
*
* @return void
*
* @throws Exception
*/
public function testNoResults(): void
{
@@ -47,6 +50,8 @@ class PruneDumpTest extends TestCase
* The Prune Dumps Action shall prune dumps before the specified date by hours from the present time.
*
* @return void
*
* @throws Exception
*/
public function testPruned(): void
{
@@ -8,6 +8,7 @@ use App\Actions\Storage\Wiki\Audio\DeleteAudioAction;
use App\Constants\Config\AudioConstants;
use App\Enums\Actions\ActionStatus;
use App\Models\Wiki\Audio;
use Exception;
use Illuminate\Foundation\Testing\WithFaker;
use Illuminate\Http\Testing\File;
use Illuminate\Http\Testing\MimeType;
@@ -102,6 +103,8 @@ class DeleteAudioTest extends TestCase
* The Delete Audio Action shall delete the audio.
*
* @return void
*
* @throws Exception
*/
public function testAudioDeleted(): void
{
@@ -8,6 +8,7 @@ use App\Actions\Storage\Wiki\Video\DeleteVideoAction;
use App\Constants\Config\VideoConstants;
use App\Enums\Actions\ActionStatus;
use App\Models\Wiki\Video;
use Exception;
use Illuminate\Foundation\Testing\WithFaker;
use Illuminate\Http\Testing\File;
use Illuminate\Http\Testing\MimeType;
@@ -102,6 +103,8 @@ class DeleteVideoTest extends TestCase
* The Delete Video Action shall delete the video.
*
* @return void
*
* @throws Exception
*/
public function testVideoDeleted(): void
{
@@ -8,6 +8,7 @@ use App\Actions\Storage\Wiki\Video\Script\DeleteScriptAction;
use App\Constants\Config\VideoConstants;
use App\Enums\Actions\ActionStatus;
use App\Models\Wiki\Video\VideoScript;
use Exception;
use Illuminate\Foundation\Testing\WithFaker;
use Illuminate\Http\Testing\File;
use Illuminate\Support\Facades\Config;
@@ -92,6 +93,8 @@ class DeleteScriptTest extends TestCase
* The Delete Video Action shall delete the script.
*
* @return void
*
* @throws Exception
*/
public function testVideoDeleted(): void
{
@@ -10,7 +10,6 @@ use App\Enums\Models\Billing\Service;
use App\Models\Billing\Balance;
use App\Repositories\DigitalOcean\Billing\DigitalOceanBalanceRepository;
use Illuminate\Foundation\Testing\WithFaker;
use Illuminate\Foundation\Testing\WithoutEvents;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Date;
use Mockery\MockInterface;
@@ -23,7 +22,6 @@ use Tests\TestCase;
class BalanceReconcileTest extends TestCase
{
use WithFaker;
use WithoutEvents;
/**
* The Reconcile Balance Command shall require a 'service' argument.
@@ -9,7 +9,6 @@ use App\Enums\Models\Billing\Service;
use App\Models\Billing\Transaction;
use App\Repositories\DigitalOcean\Billing\DigitalOceanTransactionRepository;
use Illuminate\Foundation\Testing\WithFaker;
use Illuminate\Foundation\Testing\WithoutEvents;
use Illuminate\Support\Collection;
use Mockery\MockInterface;
use Symfony\Component\Console\Exception\RuntimeException;
@@ -21,7 +20,6 @@ use Tests\TestCase;
class TransactionReconcileTest extends TestCase
{
use WithFaker;
use WithoutEvents;
/**
* The Reconcile Transaction Command shall require a 'service' argument.
@@ -8,7 +8,6 @@ use App\Console\Commands\Repositories\Storage\Wiki\AudioReconcileCommand;
use App\Models\Wiki\Audio;
use App\Repositories\Storage\Wiki\AudioRepository;
use Illuminate\Foundation\Testing\WithFaker;
use Illuminate\Foundation\Testing\WithoutEvents;
use Illuminate\Support\Collection;
use Mockery\MockInterface;
use Tests\TestCase;
@@ -19,7 +18,6 @@ use Tests\TestCase;
class AudioReconcileTest extends TestCase
{
use WithFaker;
use WithoutEvents;
/**
* If no changes are needed, the Reconcile Audio Command shall output 'No Audio created or deleted or updated'.
@@ -9,7 +9,6 @@ use App\Constants\Config\VideoConstants;
use App\Models\Wiki\Video\VideoScript;
use App\Repositories\Storage\Wiki\Video\ScriptRepository;
use Illuminate\Foundation\Testing\WithFaker;
use Illuminate\Foundation\Testing\WithoutEvents;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Config;
use Illuminate\Support\Facades\Storage;
@@ -22,7 +21,6 @@ use Tests\TestCase;
class ScriptReconcileTest extends TestCase
{
use WithFaker;
use WithoutEvents;
/**
* If no changes are needed, the Reconcile Script Command shall output 'No Video Scripts created or deleted or updated'.
@@ -9,7 +9,6 @@ use App\Constants\Config\VideoConstants;
use App\Models\Wiki\Video;
use App\Repositories\Storage\Wiki\VideoRepository;
use Illuminate\Foundation\Testing\WithFaker;
use Illuminate\Foundation\Testing\WithoutEvents;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Config;
use Illuminate\Support\Facades\Storage;
@@ -22,7 +21,6 @@ use Tests\TestCase;
class VideoReconcileTest extends TestCase
{
use WithFaker;
use WithoutEvents;
/**
* If no changes are needed, the Reconcile Video Command shall output 'No Videos created or deleted or updated'.
@@ -25,8 +25,6 @@ class AnnouncementTest extends TestCase
*/
public function testAnnouncementCreatedEventDispatched(): void
{
Event::fake();
Announcement::factory()->create();
Event::assertDispatched(AnnouncementCreated::class);
@@ -39,8 +37,6 @@ class AnnouncementTest extends TestCase
*/
public function testAnnouncementDeletedEventDispatched(): void
{
Event::fake();
$announcement = Announcement::factory()->create();
$announcement->delete();
@@ -55,8 +51,6 @@ class AnnouncementTest extends TestCase
*/
public function testAnnouncementRestoredEventDispatched(): void
{
Event::fake();
$announcement = Announcement::factory()->createOne();
$announcement->restore();
@@ -73,8 +67,6 @@ class AnnouncementTest extends TestCase
*/
public function testAnnouncementRestoresQuietly(): void
{
Event::fake();
$announcement = Announcement::factory()->createOne();
$announcement->restore();
@@ -89,8 +81,6 @@ class AnnouncementTest extends TestCase
*/
public function testAnnouncementUpdatedEventDispatched(): void
{
Event::fake();
$announcement = Announcement::factory()->createOne();
$changes = Announcement::factory()->makeOne();
@@ -107,8 +97,6 @@ class AnnouncementTest extends TestCase
*/
public function testAnnouncementUpdatedEventEmbedFields(): void
{
Event::fake();
$announcement = Announcement::factory()->createOne();
$changes = Announcement::factory()->makeOne();
-12
View File
@@ -25,8 +25,6 @@ class DumpTest extends TestCase
*/
public function testDumpCreatedEventDispatched(): void
{
Event::fake();
Dump::factory()->create();
Event::assertDispatched(DumpCreated::class);
@@ -39,8 +37,6 @@ class DumpTest extends TestCase
*/
public function testDumpDeletedEventDispatched(): void
{
Event::fake();
$dump = Dump::factory()->create();
$dump->delete();
@@ -55,8 +51,6 @@ class DumpTest extends TestCase
*/
public function testDumpRestoredEventDispatched(): void
{
Event::fake();
$dump = Dump::factory()->createOne();
$dump->restore();
@@ -73,8 +67,6 @@ class DumpTest extends TestCase
*/
public function testDumpRestoresQuietly(): void
{
Event::fake();
$dump = Dump::factory()->createOne();
$dump->restore();
@@ -89,8 +81,6 @@ class DumpTest extends TestCase
*/
public function testDumpUpdatedEventDispatched(): void
{
Event::fake();
$dump = Dump::factory()->createOne();
$changes = Dump::factory()->makeOne();
@@ -107,8 +97,6 @@ class DumpTest extends TestCase
*/
public function testDumpUpdatedEventEmbedFields(): void
{
Event::fake();
$dump = Dump::factory()->createOne();
$changes = Dump::factory()->makeOne();
@@ -24,8 +24,6 @@ class SettingTest extends TestCase
*/
public function testSettingCreatedEventDispatched(): void
{
Event::fake();
Setting::factory()->create();
Event::assertDispatched(SettingCreated::class);
@@ -38,8 +36,6 @@ class SettingTest extends TestCase
*/
public function testSettingDeletedEventDispatched(): void
{
Event::fake();
$setting = Setting::factory()->create();
$setting->delete();
@@ -54,8 +50,6 @@ class SettingTest extends TestCase
*/
public function testSettingUpdatedEventDispatched(): void
{
Event::fake();
$setting = Setting::factory()->createOne();
$changes = Setting::factory()->makeOne();
@@ -72,8 +66,6 @@ class SettingTest extends TestCase
*/
public function testSettingUpdatedEventEmbedFields(): void
{
Event::fake();
$setting = Setting::factory()->createOne();
$changes = Setting::factory()->makeOne();
-12
View File
@@ -25,8 +25,6 @@ class UserTest extends TestCase
*/
public function testUserCreatedEventDispatched(): void
{
Event::fake();
User::factory()->createOne();
Event::assertDispatched(UserCreated::class);
@@ -39,8 +37,6 @@ class UserTest extends TestCase
*/
public function testUserDeletedEventDispatched(): void
{
Event::fake();
$user = User::factory()->createOne();
$user->delete();
@@ -55,8 +51,6 @@ class UserTest extends TestCase
*/
public function testUserRestoredEventDispatched(): void
{
Event::fake();
$user = User::factory()->createOne();
$user->restore();
@@ -73,8 +67,6 @@ class UserTest extends TestCase
*/
public function testUserRestoresQuietly(): void
{
Event::fake();
$user = User::factory()->createOne();
$user->restore();
@@ -89,8 +81,6 @@ class UserTest extends TestCase
*/
public function testUserUpdatedEventDispatched(): void
{
Event::fake();
$user = User::factory()->createOne();
$changes = User::factory()->makeOne();
@@ -107,8 +97,6 @@ class UserTest extends TestCase
*/
public function testUserUpdatedEventEmbedFields(): void
{
Event::fake();
$user = User::factory()->createOne();
$changes = User::factory()->makeOne();
@@ -25,8 +25,6 @@ class BalanceTest extends TestCase
*/
public function testBalanceCreatedEventDispatched(): void
{
Event::fake();
Balance::factory()->createOne();
Event::assertDispatched(BalanceCreated::class);
@@ -39,8 +37,6 @@ class BalanceTest extends TestCase
*/
public function testBalanceDeletedEventDispatched(): void
{
Event::fake();
$balance = Balance::factory()->createOne();
$balance->delete();
@@ -55,8 +51,6 @@ class BalanceTest extends TestCase
*/
public function testBalanceRestoredEventDispatched(): void
{
Event::fake();
$balance = Balance::factory()->createOne();
$balance->restore();
@@ -73,8 +67,6 @@ class BalanceTest extends TestCase
*/
public function testBalanceRestoresQuietly(): void
{
Event::fake();
$balance = Balance::factory()->createOne();
$balance->restore();
@@ -89,8 +81,6 @@ class BalanceTest extends TestCase
*/
public function testBalanceUpdatedEventDispatched(): void
{
Event::fake();
$balance = Balance::factory()->createOne();
$changes = Balance::factory()->makeOne();
@@ -107,8 +97,6 @@ class BalanceTest extends TestCase
*/
public function testBalanceUpdatedEventEmbedFields(): void
{
Event::fake();
$balance = Balance::factory()->createOne();
$changes = Balance::factory()->makeOne();
@@ -25,8 +25,6 @@ class TransactionTest extends TestCase
*/
public function testTransactionCreatedEventDispatched(): void
{
Event::fake();
Transaction::factory()->createOne();
Event::assertDispatched(TransactionCreated::class);
@@ -39,8 +37,6 @@ class TransactionTest extends TestCase
*/
public function testTransactionDeletedEventDispatched(): void
{
Event::fake();
$transaction = Transaction::factory()->createOne();
$transaction->delete();
@@ -55,8 +51,6 @@ class TransactionTest extends TestCase
*/
public function testTransactionRestoredEventDispatched(): void
{
Event::fake();
$transaction = Transaction::factory()->createOne();
$transaction->restore();
@@ -73,8 +67,6 @@ class TransactionTest extends TestCase
*/
public function testTransactionRestoresQuietly(): void
{
Event::fake();
$transaction = Transaction::factory()->createOne();
$transaction->restore();
@@ -89,8 +81,6 @@ class TransactionTest extends TestCase
*/
public function testTransactionUpdatedEventDispatched(): void
{
Event::fake();
$transaction = Transaction::factory()->createOne();
$changes = Transaction::factory()->makeOne();
@@ -107,8 +97,6 @@ class TransactionTest extends TestCase
*/
public function testTransactionUpdatedEventEmbedFields(): void
{
Event::fake();
$transaction = Transaction::factory()->createOne();
$changes = Transaction::factory()->makeOne();
@@ -25,8 +25,6 @@ class PageTest extends TestCase
*/
public function testPageCreatedEventDispatched(): void
{
Event::fake();
Page::factory()->createOne();
Event::assertDispatched(PageCreated::class);
@@ -39,8 +37,6 @@ class PageTest extends TestCase
*/
public function testPageDeletedEventDispatched(): void
{
Event::fake();
$page = Page::factory()->createOne();
$page->delete();
@@ -55,8 +51,6 @@ class PageTest extends TestCase
*/
public function testPageRestoredEventDispatched(): void
{
Event::fake();
$page = Page::factory()->createOne();
$page->restore();
@@ -73,8 +67,6 @@ class PageTest extends TestCase
*/
public function testPageRestoresQuietly(): void
{
Event::fake();
$page = Page::factory()->createOne();
$page->restore();
@@ -89,8 +81,6 @@ class PageTest extends TestCase
*/
public function testPageUpdatedEventDispatched(): void
{
Event::fake();
$page = Page::factory()->createOne();
$changes = Page::factory()->makeOne();
@@ -107,8 +97,6 @@ class PageTest extends TestCase
*/
public function testPageUpdatedEventEmbedFields(): void
{
Event::fake();
$page = Page::factory()->createOne();
$changes = Page::factory()->makeOne();
@@ -27,8 +27,6 @@ class TrackTest extends TestCase
*/
public function testTrackCreatedEventDispatched(): void
{
Event::fake();
PlaylistTrack::factory()
->for(Playlist::factory())
->createOne();
@@ -43,8 +41,6 @@ class TrackTest extends TestCase
*/
public function testTrackDeletedEventDispatched(): void
{
Event::fake();
$track = PlaylistTrack::factory()
->for(Playlist::factory())
->createOne();
@@ -61,8 +57,6 @@ class TrackTest extends TestCase
*/
public function testTrackRestoredEventDispatched(): void
{
Event::fake();
$track = PlaylistTrack::factory()
->for(Playlist::factory())
->createOne();
@@ -81,8 +75,6 @@ class TrackTest extends TestCase
*/
public function testTrackRestoresQuietly(): void
{
Event::fake();
$track = PlaylistTrack::factory()
->for(Playlist::factory())
->createOne();
@@ -99,8 +91,6 @@ class TrackTest extends TestCase
*/
public function testTrackUpdatedEventDispatched(): void
{
Event::fake();
$track = PlaylistTrack::factory()
->for(Playlist::factory())
->createOne();
@@ -122,8 +112,6 @@ class TrackTest extends TestCase
*/
public function testPlaylistUpdatedEventEmbedFields(): void
{
Event::fake();
$track = PlaylistTrack::factory()
->for(Playlist::factory())
->createOne();
@@ -27,8 +27,6 @@ class PlaylistTest extends TestCase
*/
public function testPlaylistCreatedEventDispatched(): void
{
Event::fake();
Playlist::factory()->createOne();
Event::assertDispatched(PlaylistCreated::class);
@@ -41,8 +39,6 @@ class PlaylistTest extends TestCase
*/
public function testPlaylistDeletedEventDispatched(): void
{
Event::fake();
$playlist = Playlist::factory()->createOne();
$playlist->delete();
@@ -57,8 +53,6 @@ class PlaylistTest extends TestCase
*/
public function testPlaylistRestoredEventDispatched(): void
{
Event::fake();
$playlist = Playlist::factory()->createOne();
$playlist->restore();
@@ -75,8 +69,6 @@ class PlaylistTest extends TestCase
*/
public function testPlaylistRestoresQuietly(): void
{
Event::fake();
$playlist = Playlist::factory()->createOne();
$playlist->restore();
@@ -91,8 +83,6 @@ class PlaylistTest extends TestCase
*/
public function testPlaylistUpdatedEventDispatched(): void
{
Event::fake();
$playlist = Playlist::factory()->createOne();
$changes = Playlist::factory()->makeOne();
@@ -109,8 +99,6 @@ class PlaylistTest extends TestCase
*/
public function testPlaylistUpdatedEventEmbedFields(): void
{
Event::fake();
$playlist = Playlist::factory()->createOne();
$changes = Playlist::factory()->makeOne();
@@ -23,8 +23,6 @@ class PlaylistImageTest extends TestCase
*/
public function testPlaylistImageCreatedEventDispatched(): void
{
Event::fake();
$playlist = Playlist::factory()->createOne();
$image = Image::factory()->createOne();
@@ -40,8 +38,6 @@ class PlaylistImageTest extends TestCase
*/
public function testPlaylistImageDeletedEventDispatched(): void
{
Event::fake();
$playlist = Playlist::factory()->createOne();
$image = Image::factory()->createOne();
@@ -23,8 +23,6 @@ class AnimeImageTest extends TestCase
*/
public function testAnimeImageCreatedEventDispatched(): void
{
Event::fake();
$anime = Anime::factory()->createOne();
$image = Image::factory()->createOne();
@@ -40,8 +38,6 @@ class AnimeImageTest extends TestCase
*/
public function testAnimeImageDeletedEventDispatched(): void
{
Event::fake();
$anime = Anime::factory()->createOne();
$image = Image::factory()->createOne();
@@ -26,8 +26,6 @@ class AnimeResourceTest extends TestCase
*/
public function testAnimeResourceCreatedEventDispatched(): void
{
Event::fake();
$anime = Anime::factory()->createOne();
$resource = ExternalResource::factory()->createOne();
@@ -43,8 +41,6 @@ class AnimeResourceTest extends TestCase
*/
public function testAnimeResourceDeletedEventDispatched(): void
{
Event::fake();
$anime = Anime::factory()->createOne();
$resource = ExternalResource::factory()->createOne();
@@ -61,8 +57,6 @@ class AnimeResourceTest extends TestCase
*/
public function testAnimeResourceUpdatedEventDispatched(): void
{
Event::fake();
$anime = Anime::factory()->createOne();
$resource = ExternalResource::factory()->createOne();
@@ -89,8 +83,6 @@ class AnimeResourceTest extends TestCase
*/
public function testAnimeResourceUpdatedEventEmbedFields(): void
{
Event::fake();
$anime = Anime::factory()->createOne();
$resource = ExternalResource::factory()->createOne();
@@ -23,8 +23,6 @@ class AnimeSeriesTest extends TestCase
*/
public function testAnimeSeriesCreatedEventDispatched(): void
{
Event::fake();
$anime = Anime::factory()->createOne();
$series = Series::factory()->createOne();
@@ -40,8 +38,6 @@ class AnimeSeriesTest extends TestCase
*/
public function testAnimeSeriesDeletedEventDispatched(): void
{
Event::fake();
$anime = Anime::factory()->createOne();
$series = Series::factory()->createOne();
@@ -23,8 +23,6 @@ class AnimeStudioTest extends TestCase
*/
public function testAnimeStudioCreatedEventDispatched(): void
{
Event::fake();
$anime = Anime::factory()->createOne();
$studio = Studio::factory()->createOne();
@@ -40,8 +38,6 @@ class AnimeStudioTest extends TestCase
*/
public function testAnimeStudioDeletedEventDispatched(): void
{
Event::fake();
$anime = Anime::factory()->createOne();
$studio = Studio::factory()->createOne();
@@ -25,8 +25,6 @@ class AnimeThemeEntryVideoTest extends TestCase
*/
public function testAnimeThemeEntryVideoCreatedEventDispatched(): void
{
Event::fake(AnimeThemeEntryVideoCreated::class);
$video = Video::factory()->createOne();
$entry = AnimeThemeEntry::factory()
->for(AnimeTheme::factory()->for(Anime::factory()))
@@ -44,8 +42,6 @@ class AnimeThemeEntryVideoTest extends TestCase
*/
public function testAnimeThemeEntryVideoDeletedEventDispatched(): void
{
Event::fake(AnimeThemeEntryVideoDeleted::class);
$video = Video::factory()->createOne();
$entry = AnimeThemeEntry::factory()
->for(AnimeTheme::factory()->for(Anime::factory()))
@@ -23,8 +23,6 @@ class ArtistImageTest extends TestCase
*/
public function testArtistImageCreatedEventDispatched(): void
{
Event::fake();
$artist = Artist::factory()->createOne();
$image = Image::factory()->createOne();
@@ -40,8 +38,6 @@ class ArtistImageTest extends TestCase
*/
public function testArtistImageDeletedEventDispatched(): void
{
Event::fake();
$artist = Artist::factory()->createOne();
$image = Image::factory()->createOne();
@@ -25,8 +25,6 @@ class ArtistMemberTest extends TestCase
*/
public function testArtistMemberCreatedEventDispatched(): void
{
Event::fake();
$artist = Artist::factory()->createOne();
$member = Artist::factory()->createOne();
@@ -42,8 +40,6 @@ class ArtistMemberTest extends TestCase
*/
public function testArtistMemberDeletedEventDispatched(): void
{
Event::fake();
$artist = Artist::factory()->createOne();
$member = Artist::factory()->createOne();
@@ -60,8 +56,6 @@ class ArtistMemberTest extends TestCase
*/
public function testArtistMemberUpdatedEventDispatched(): void
{
Event::fake();
$artist = Artist::factory()->createOne();
$member = Artist::factory()->createOne();
@@ -88,8 +82,6 @@ class ArtistMemberTest extends TestCase
*/
public function testArtistMemberUpdatedEventEmbedFields(): void
{
Event::fake();
$artist = Artist::factory()->createOne();
$member = Artist::factory()->createOne();
@@ -26,8 +26,6 @@ class ArtistResourceTest extends TestCase
*/
public function testArtistResourceCreatedEventDispatched(): void
{
Event::fake();
$artist = Artist::factory()->createOne();
$resource = ExternalResource::factory()->createOne();
@@ -43,8 +41,6 @@ class ArtistResourceTest extends TestCase
*/
public function testArtistResourceDeletedEventDispatched(): void
{
Event::fake();
$artist = Artist::factory()->createOne();
$resource = ExternalResource::factory()->createOne();
@@ -61,8 +57,6 @@ class ArtistResourceTest extends TestCase
*/
public function testArtistResourceUpdatedEventDispatched(): void
{
Event::fake();
$artist = Artist::factory()->createOne();
$resource = ExternalResource::factory()->createOne();
@@ -89,8 +83,6 @@ class ArtistResourceTest extends TestCase
*/
public function testArtistResourceUpdatedEventEmbedFields(): void
{
Event::fake();
$artist = Artist::factory()->createOne();
$resource = ExternalResource::factory()->createOne();
@@ -26,8 +26,6 @@ class ArtistSongTest extends TestCase
*/
public function testArtistSongCreatedEventDispatched(): void
{
Event::fake();
$artist = Artist::factory()->createOne();
$song = Song::factory()->createOne();
@@ -43,8 +41,6 @@ class ArtistSongTest extends TestCase
*/
public function testArtistSongDeletedEventDispatched(): void
{
Event::fake();
$artist = Artist::factory()->createOne();
$song = Song::factory()->createOne();
@@ -61,8 +57,6 @@ class ArtistSongTest extends TestCase
*/
public function testArtistSongUpdatedEventDispatched(): void
{
Event::fake();
$artist = Artist::factory()->createOne();
$song = Song::factory()->createOne();
@@ -89,8 +83,6 @@ class ArtistSongTest extends TestCase
*/
public function testArtistSongUpdatedEventEmbedFields(): void
{
Event::fake();
$artist = Artist::factory()->createOne();
$song = Song::factory()->createOne();
@@ -23,8 +23,6 @@ class StudioImageTest extends TestCase
*/
public function testStudioImageCreatedEventDispatched(): void
{
Event::fake();
$studio = Studio::factory()->createOne();
$image = Image::factory()->createOne();
@@ -40,8 +38,6 @@ class StudioImageTest extends TestCase
*/
public function testStudioImageDeletedEventDispatched(): void
{
Event::fake();
$studio = Studio::factory()->createOne();
$image = Image::factory()->createOne();
@@ -26,8 +26,6 @@ class StudioResourceTest extends TestCase
*/
public function testStudioResourceCreatedEventDispatched(): void
{
Event::fake();
$studio = Studio::factory()->createOne();
$resource = ExternalResource::factory()->createOne();
@@ -43,8 +41,6 @@ class StudioResourceTest extends TestCase
*/
public function testStudioResourceDeletedEventDispatched(): void
{
Event::fake();
$studio = Studio::factory()->createOne();
$resource = ExternalResource::factory()->createOne();
@@ -61,8 +57,6 @@ class StudioResourceTest extends TestCase
*/
public function testStudioResourceUpdatedEventDispatched(): void
{
Event::fake();
$studio = Studio::factory()->createOne();
$resource = ExternalResource::factory()->createOne();
@@ -89,8 +83,6 @@ class StudioResourceTest extends TestCase
*/
public function testStudioResourceUpdatedEventEmbedFields(): void
{
Event::fake();
$studio = Studio::factory()->createOne();
$resource = ExternalResource::factory()->createOne();
@@ -26,8 +26,6 @@ class SynonymTest extends TestCase
*/
public function testSynonymCreatedEventDispatched(): void
{
Event::fake();
AnimeSynonym::factory()
->for(Anime::factory())
->createOne();
@@ -42,8 +40,6 @@ class SynonymTest extends TestCase
*/
public function testSynonymDeletedEventDispatched(): void
{
Event::fake();
$synonym = AnimeSynonym::factory()
->for(Anime::factory())
->createOne();
@@ -60,8 +56,6 @@ class SynonymTest extends TestCase
*/
public function testSynonymRestoredEventDispatched(): void
{
Event::fake();
$synonym = AnimeSynonym::factory()
->for(Anime::factory())
->createOne();
@@ -80,8 +74,6 @@ class SynonymTest extends TestCase
*/
public function testSynonymRestoresQuietly(): void
{
Event::fake();
$synonym = AnimeSynonym::factory()
->for(Anime::factory())
->createOne();
@@ -98,8 +90,6 @@ class SynonymTest extends TestCase
*/
public function testSynonymUpdatedEventDispatched(): void
{
Event::fake();
$synonym = AnimeSynonym::factory()
->for(Anime::factory())
->createOne();
@@ -121,8 +111,6 @@ class SynonymTest extends TestCase
*/
public function testSynonymUpdatedEventEmbedFields(): void
{
Event::fake();
$synonym = AnimeSynonym::factory()
->for(Anime::factory())
->createOne();
@@ -27,8 +27,6 @@ class EntryTest extends TestCase
*/
public function testEntryCreatedEventDispatched(): void
{
Event::fake();
AnimeThemeEntry::factory()
->for(AnimeTheme::factory()->for(Anime::factory()))
->createOne();
@@ -43,8 +41,6 @@ class EntryTest extends TestCase
*/
public function testEntryDeletedEventDispatched(): void
{
Event::fake();
$entry = AnimeThemeEntry::factory()
->for(AnimeTheme::factory()->for(Anime::factory()))
->createOne();
@@ -61,8 +57,6 @@ class EntryTest extends TestCase
*/
public function testEntryRestoredEventDispatched(): void
{
Event::fake();
$entry = AnimeThemeEntry::factory()
->for(AnimeTheme::factory()->for(Anime::factory()))
->createOne();
@@ -81,8 +75,6 @@ class EntryTest extends TestCase
*/
public function testEntryRestoresQuietly(): void
{
Event::fake();
$entry = AnimeThemeEntry::factory()
->for(AnimeTheme::factory()->for(Anime::factory()))
->createOne();
@@ -99,8 +91,6 @@ class EntryTest extends TestCase
*/
public function testEntryUpdatedEventDispatched(): void
{
Event::fake();
$entry = AnimeThemeEntry::factory()
->for(AnimeTheme::factory()->for(Anime::factory()))
->createOne();
@@ -122,8 +112,6 @@ class EntryTest extends TestCase
*/
public function testEntryUpdatedEventEmbedFields(): void
{
Event::fake();
$entry = AnimeThemeEntry::factory()
->for(AnimeTheme::factory()->for(Anime::factory()))
->createOne();
@@ -26,8 +26,6 @@ class ThemeTest extends TestCase
*/
public function testThemeCreatedEventDispatched(): void
{
Event::fake();
AnimeTheme::factory()
->for(Anime::factory())
->createOne();
@@ -42,8 +40,6 @@ class ThemeTest extends TestCase
*/
public function testThemeDeletedEventDispatched(): void
{
Event::fake();
$theme = AnimeTheme::factory()
->for(Anime::factory())
->createOne();
@@ -60,8 +56,6 @@ class ThemeTest extends TestCase
*/
public function testThemeRestoredEventDispatched(): void
{
Event::fake();
$theme = AnimeTheme::factory()
->for(Anime::factory())
->createOne();
@@ -80,8 +74,6 @@ class ThemeTest extends TestCase
*/
public function testThemeRestoresQuietly(): void
{
Event::fake();
$theme = AnimeTheme::factory()
->for(Anime::factory())
->createOne();
@@ -98,8 +90,6 @@ class ThemeTest extends TestCase
*/
public function testThemeUpdatedEventDispatched(): void
{
Event::fake();
$theme = AnimeTheme::factory()
->for(Anime::factory())
->createOne();
@@ -121,8 +111,6 @@ class ThemeTest extends TestCase
*/
public function testThemeUpdatedEventEmbedFields(): void
{
Event::fake();
$theme = AnimeTheme::factory()
->for(Anime::factory())
->createOne();
-12
View File
@@ -25,8 +25,6 @@ class AnimeTest extends TestCase
*/
public function testAnimeCreatedEventDispatched(): void
{
Event::fake();
Anime::factory()->createOne();
Event::assertDispatched(AnimeCreated::class);
@@ -39,8 +37,6 @@ class AnimeTest extends TestCase
*/
public function testAnimeDeletedEventDispatched(): void
{
Event::fake();
$anime = Anime::factory()->createOne();
$anime->delete();
@@ -55,8 +51,6 @@ class AnimeTest extends TestCase
*/
public function testAnimeRestoredEventDispatched(): void
{
Event::fake();
$anime = Anime::factory()->createOne();
$anime->restore();
@@ -73,8 +67,6 @@ class AnimeTest extends TestCase
*/
public function testAnimeRestoresQuietly(): void
{
Event::fake();
$anime = Anime::factory()->createOne();
$anime->restore();
@@ -89,8 +81,6 @@ class AnimeTest extends TestCase
*/
public function testAnimeUpdatedEventDispatched(): void
{
Event::fake();
$anime = Anime::factory()->createOne();
$changes = Anime::factory()->makeOne();
@@ -107,8 +97,6 @@ class AnimeTest extends TestCase
*/
public function testAnimeUpdatedEventEmbedFields(): void
{
Event::fake();
$anime = Anime::factory()->createOne();
$changes = Anime::factory()->makeOne();
-12
View File
@@ -25,8 +25,6 @@ class ArtistTest extends TestCase
*/
public function testArtistCreatedEventDispatched(): void
{
Event::fake();
Artist::factory()->createOne();
Event::assertDispatched(ArtistCreated::class);
@@ -39,8 +37,6 @@ class ArtistTest extends TestCase
*/
public function testArtistDeletedEventDispatched(): void
{
Event::fake();
$artist = Artist::factory()->createOne();
$artist->delete();
@@ -55,8 +51,6 @@ class ArtistTest extends TestCase
*/
public function testArtistRestoredEventDispatched(): void
{
Event::fake();
$artist = Artist::factory()->createOne();
$artist->restore();
@@ -73,8 +67,6 @@ class ArtistTest extends TestCase
*/
public function testArtistRestoresQuietly(): void
{
Event::fake();
$artist = Artist::factory()->createOne();
$artist->restore();
@@ -89,8 +81,6 @@ class ArtistTest extends TestCase
*/
public function testArtistUpdatedEventDispatched(): void
{
Event::fake();
$artist = Artist::factory()->createOne();
$changes = Artist::factory()->makeOne();
@@ -107,8 +97,6 @@ class ArtistTest extends TestCase
*/
public function testArtistUpdatedEventEmbedFields(): void
{
Event::fake();
$artist = Artist::factory()->createOne();
$changes = Artist::factory()->makeOne();
-12
View File
@@ -25,8 +25,6 @@ class AudioTest extends TestCase
*/
public function testAudioCreatedEventDispatched(): void
{
Event::fake();
Audio::factory()->createOne();
Event::assertDispatched(AudioCreated::class);
@@ -39,8 +37,6 @@ class AudioTest extends TestCase
*/
public function testAudioDeletedEventDispatched(): void
{
Event::fake();
$audio = Audio::factory()->createOne();
$audio->delete();
@@ -55,8 +51,6 @@ class AudioTest extends TestCase
*/
public function testAudioRestoredEventDispatched(): void
{
Event::fake();
$audio = Audio::factory()->createOne();
$audio->restore();
@@ -73,8 +67,6 @@ class AudioTest extends TestCase
*/
public function testAudioRestoresQuietly(): void
{
Event::fake();
$audio = Audio::factory()->createOne();
$audio->restore();
@@ -89,8 +81,6 @@ class AudioTest extends TestCase
*/
public function testAudioUpdatedEventDispatched(): void
{
Event::fake();
$audio = Audio::factory()->createOne();
$changes = Audio::factory()->makeOne();
@@ -107,8 +97,6 @@ class AudioTest extends TestCase
*/
public function testAudioUpdatedEventEmbedFields(): void
{
Event::fake();
$audio = Audio::factory()->createOne();
$changes = Audio::factory()->makeOne();
@@ -25,8 +25,6 @@ class ExternalResourceTest extends TestCase
*/
public function testExternalResourceCreatedEventDispatched(): void
{
Event::fake();
ExternalResource::factory()->createOne();
Event::assertDispatched(ExternalResourceCreated::class);
@@ -39,8 +37,6 @@ class ExternalResourceTest extends TestCase
*/
public function testExternalResourceDeletedEventDispatched(): void
{
Event::fake();
$resource = ExternalResource::factory()->createOne();
$resource->delete();
@@ -55,8 +51,6 @@ class ExternalResourceTest extends TestCase
*/
public function testExternalResourceRestoredEventDispatched(): void
{
Event::fake();
$resource = ExternalResource::factory()->createOne();
$resource->restore();
@@ -73,8 +67,6 @@ class ExternalResourceTest extends TestCase
*/
public function testExternalResourceRestoresQuietly(): void
{
Event::fake();
$resource = ExternalResource::factory()->createOne();
$resource->restore();
@@ -89,8 +81,6 @@ class ExternalResourceTest extends TestCase
*/
public function testExternalResourceUpdatedEventDispatched(): void
{
Event::fake();
$resource = ExternalResource::factory()->createOne();
$changes = ExternalResource::factory()->makeOne();
@@ -107,8 +97,6 @@ class ExternalResourceTest extends TestCase
*/
public function testExternalResourceUpdatedEventEmbedFields(): void
{
Event::fake();
$resource = ExternalResource::factory()->createOne();
$changes = ExternalResource::factory()->makeOne();
-12
View File
@@ -25,8 +25,6 @@ class ImageTest extends TestCase
*/
public function testImageCreatedEventDispatched(): void
{
Event::fake();
Image::factory()->createOne();
Event::assertDispatched(ImageCreated::class);
@@ -39,8 +37,6 @@ class ImageTest extends TestCase
*/
public function testImageDeletedEventDispatched(): void
{
Event::fake();
$image = Image::factory()->createOne();
$image->delete();
@@ -55,8 +51,6 @@ class ImageTest extends TestCase
*/
public function testImageRestoredEventDispatched(): void
{
Event::fake();
$image = Image::factory()->createOne();
$image->restore();
@@ -73,8 +67,6 @@ class ImageTest extends TestCase
*/
public function testImageRestoresQuietly(): void
{
Event::fake();
$image = Image::factory()->createOne();
$image->restore();
@@ -89,8 +81,6 @@ class ImageTest extends TestCase
*/
public function testImageUpdatedEventDispatched(): void
{
Event::fake();
$image = Image::factory()->createOne();
$changes = Image::factory()->makeOne();
@@ -107,8 +97,6 @@ class ImageTest extends TestCase
*/
public function testImageUpdatedEventEmbedFields(): void
{
Event::fake();
$image = Image::factory()->createOne();
$changes = Image::factory()->makeOne();
-12
View File
@@ -25,8 +25,6 @@ class SeriesTest extends TestCase
*/
public function testSeriesCreatedEventDispatched(): void
{
Event::fake();
Series::factory()->createOne();
Event::assertDispatched(SeriesCreated::class);
@@ -39,8 +37,6 @@ class SeriesTest extends TestCase
*/
public function testSeriesDeletedEventDispatched(): void
{
Event::fake();
$series = Series::factory()->createOne();
$series->delete();
@@ -55,8 +51,6 @@ class SeriesTest extends TestCase
*/
public function testSeriesRestoredEventDispatched(): void
{
Event::fake();
$series = Series::factory()->createOne();
$series->restore();
@@ -73,8 +67,6 @@ class SeriesTest extends TestCase
*/
public function testSeriesRestoresQuietly(): void
{
Event::fake();
$series = Series::factory()->createOne();
$series->restore();
@@ -89,8 +81,6 @@ class SeriesTest extends TestCase
*/
public function testSeriesUpdatedEventDispatched(): void
{
Event::fake();
$series = Series::factory()->createOne();
$changes = Series::factory()->makeOne();
@@ -107,8 +97,6 @@ class SeriesTest extends TestCase
*/
public function testSeriesUpdatedEventEmbedFields(): void
{
Event::fake();
$series = Series::factory()->createOne();
$changes = Series::factory()->makeOne();
-12
View File
@@ -25,8 +25,6 @@ class SongTest extends TestCase
*/
public function testSongCreatedEventDispatched(): void
{
Event::fake();
Song::factory()->createOne();
Event::assertDispatched(SongCreated::class);
@@ -39,8 +37,6 @@ class SongTest extends TestCase
*/
public function testSongDeletedEventDispatched(): void
{
Event::fake();
$song = Song::factory()->createOne();
$song->delete();
@@ -55,8 +51,6 @@ class SongTest extends TestCase
*/
public function testSongRestoredEventDispatched(): void
{
Event::fake();
$song = Song::factory()->createOne();
$song->restore();
@@ -73,8 +67,6 @@ class SongTest extends TestCase
*/
public function testSongRestoresQuietly(): void
{
Event::fake();
$song = Song::factory()->createOne();
$song->restore();
@@ -89,8 +81,6 @@ class SongTest extends TestCase
*/
public function testSongUpdatedEventDispatched(): void
{
Event::fake();
$song = Song::factory()->createOne();
$changes = Song::factory()->makeOne();
@@ -107,8 +97,6 @@ class SongTest extends TestCase
*/
public function testSongUpdatedEventEmbedFields(): void
{
Event::fake();
$song = Song::factory()->createOne();
$changes = Song::factory()->makeOne();
-12
View File
@@ -25,8 +25,6 @@ class StudioTest extends TestCase
*/
public function testStudioCreatedEventDispatched(): void
{
Event::fake();
Studio::factory()->createOne();
Event::assertDispatched(StudioCreated::class);
@@ -39,8 +37,6 @@ class StudioTest extends TestCase
*/
public function testStudioDeletedEventDispatched(): void
{
Event::fake();
$studio = Studio::factory()->createOne();
$studio->delete();
@@ -55,8 +51,6 @@ class StudioTest extends TestCase
*/
public function testStudioRestoredEventDispatched(): void
{
Event::fake();
$studio = Studio::factory()->createOne();
$studio->restore();
@@ -73,8 +67,6 @@ class StudioTest extends TestCase
*/
public function testStudioRestoresQuietly(): void
{
Event::fake();
$studio = Studio::factory()->createOne();
$studio->restore();
@@ -89,8 +81,6 @@ class StudioTest extends TestCase
*/
public function testStudioUpdatedEventDispatched(): void
{
Event::fake();
$studio = Studio::factory()->createOne();
$changes = Studio::factory()->makeOne();
@@ -107,8 +97,6 @@ class StudioTest extends TestCase
*/
public function testStudioUpdatedEventEmbedFields(): void
{
Event::fake();
$studio = Studio::factory()->createOne();
$changes = Studio::factory()->makeOne();
@@ -25,8 +25,6 @@ class ScriptTest extends TestCase
*/
public function testVideoScriptCreatedEventDispatched(): void
{
Event::fake();
VideoScript::factory()->createOne();
Event::assertDispatched(VideoScriptCreated::class);
@@ -39,8 +37,6 @@ class ScriptTest extends TestCase
*/
public function testVideoScriptDeletedEventDispatched(): void
{
Event::fake();
$script = VideoScript::factory()->createOne();
$script->delete();
@@ -55,8 +51,6 @@ class ScriptTest extends TestCase
*/
public function testVideoScriptRestoredEventDispatched(): void
{
Event::fake();
$script = VideoScript::factory()->createOne();
$script->restore();
@@ -73,8 +67,6 @@ class ScriptTest extends TestCase
*/
public function testVideoScriptRestoresQuietly(): void
{
Event::fake();
$script = VideoScript::factory()->createOne();
$script->restore();
@@ -89,8 +81,6 @@ class ScriptTest extends TestCase
*/
public function testVideoScriptUpdatedEventDispatched(): void
{
Event::fake();
$script = VideoScript::factory()->createOne();
$changes = VideoScript::factory()->makeOne();
@@ -107,8 +97,6 @@ class ScriptTest extends TestCase
*/
public function testVideoScriptUpdatedEventEmbedFields(): void
{
Event::fake();
$script = VideoScript::factory()->createOne();
$changes = VideoScript::factory()->makeOne();
-12
View File
@@ -25,8 +25,6 @@ class VideoTest extends TestCase
*/
public function testVideoCreatedEventDispatched(): void
{
Event::fake();
Video::factory()->createOne();
Event::assertDispatched(VideoCreated::class);
@@ -39,8 +37,6 @@ class VideoTest extends TestCase
*/
public function testVideoDeletedEventDispatched(): void
{
Event::fake();
$video = Video::factory()->createOne();
$video->delete();
@@ -55,8 +51,6 @@ class VideoTest extends TestCase
*/
public function testVideoRestoredEventDispatched(): void
{
Event::fake();
$video = Video::factory()->createOne();
$video->restore();
@@ -73,8 +67,6 @@ class VideoTest extends TestCase
*/
public function testVideoRestoresQuietly(): void
{
Event::fake();
$video = Video::factory()->createOne();
$video->restore();
@@ -89,8 +81,6 @@ class VideoTest extends TestCase
*/
public function testVideoUpdatedEventDispatched(): void
{
Event::fake();
$video = Video::factory()->createOne();
$changes = Video::factory()->makeOne();
@@ -107,8 +97,6 @@ class VideoTest extends TestCase
*/
public function testVideoUpdatedEventEmbedFields(): void
{
Event::fake();
$video = Video::factory()->createOne();
$changes = Video::factory()->makeOne();
-2
View File
@@ -10,7 +10,6 @@ use App\Enums\Auth\SpecialPermission;
use App\Models\Admin\Dump;
use App\Models\Auth\User;
use Illuminate\Foundation\Testing\WithFaker;
use Illuminate\Foundation\Testing\WithoutEvents;
use Illuminate\Http\Testing\File;
use Illuminate\Support\Facades\Config;
use Illuminate\Support\Facades\Storage;
@@ -23,7 +22,6 @@ use Tests\TestCase;
class DumpTest extends TestCase
{
use WithFaker;
use WithoutEvents;
/**
* If dump downloading is disabled through the 'flags.allow_dump_downloading' property,
@@ -11,8 +11,8 @@ use App\Constants\Config\FlagConstants;
use App\Enums\Auth\SpecialPermission;
use App\Models\Admin\Dump;
use App\Models\Auth\User;
use Exception;
use Illuminate\Foundation\Testing\WithFaker;
use Illuminate\Foundation\Testing\WithoutEvents;
use Illuminate\Http\Testing\File;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Config;
@@ -27,13 +27,14 @@ use Tests\TestCase;
class LatestDocumentDumpTest extends TestCase
{
use WithFaker;
use WithoutEvents;
/**
* If dump downloading is disabled through the 'flags.allow_dump_downloading' property,
* the user shall receive a forbidden exception.
*
* @return void
*
* @throws Exception
*/
public function testDumpDownloadingNotAllowedForbidden(): void
{
@@ -11,8 +11,8 @@ use App\Constants\Config\FlagConstants;
use App\Enums\Auth\SpecialPermission;
use App\Models\Admin\Dump;
use App\Models\Auth\User;
use Exception;
use Illuminate\Foundation\Testing\WithFaker;
use Illuminate\Foundation\Testing\WithoutEvents;
use Illuminate\Http\Testing\File;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Config;
@@ -27,13 +27,14 @@ use Tests\TestCase;
class LatestWikiDumpTest extends TestCase
{
use WithFaker;
use WithoutEvents;
/**
* If dump downloading is disabled through the 'flags.allow_dump_downloading' property,
* the user shall receive a forbidden exception.
*
* @return void
*
* @throws Exception
*/
public function testDumpDownloadingNotAllowedForbidden(): void
{
@@ -7,7 +7,6 @@ namespace Tests\Feature\Http\Api\Admin\Announcement;
use App\Enums\Auth\CrudPermission;
use App\Models\Admin\Announcement;
use App\Models\Auth\User;
use Illuminate\Foundation\Testing\WithoutEvents;
use Laravel\Sanctum\Sanctum;
use Tests\TestCase;
@@ -16,8 +15,6 @@ use Tests\TestCase;
*/
class AnnouncementDestroyTest extends TestCase
{
use WithoutEvents;
/**
* The Announcement Destroy Endpoint shall be protected by sanctum.
*
@@ -7,7 +7,6 @@ namespace Tests\Feature\Http\Api\Admin\Announcement;
use App\Enums\Auth\ExtendedCrudPermission;
use App\Models\Admin\Announcement;
use App\Models\Auth\User;
use Illuminate\Foundation\Testing\WithoutEvents;
use Laravel\Sanctum\Sanctum;
use Tests\TestCase;
@@ -16,8 +15,6 @@ use Tests\TestCase;
*/
class AnnouncementForceDeleteTest extends TestCase
{
use WithoutEvents;
/**
* The Announcement Force Delete Endpoint shall be protected by sanctum.
*
@@ -24,7 +24,6 @@ use App\Http\Resources\Admin\Resource\AnnouncementResource;
use App\Models\Admin\Announcement;
use App\Models\BaseModel;
use Illuminate\Foundation\Testing\WithFaker;
use Illuminate\Foundation\Testing\WithoutEvents;
use Illuminate\Support\Carbon;
use Tests\TestCase;
@@ -35,7 +34,6 @@ class AnnouncementIndexTest extends TestCase
{
use SortsModels;
use WithFaker;
use WithoutEvents;
/**
* By default, the Announcement Index Endpoint shall return a collection of Announcement Resources.
@@ -7,7 +7,6 @@ namespace Tests\Feature\Http\Api\Admin\Announcement;
use App\Enums\Auth\ExtendedCrudPermission;
use App\Models\Admin\Announcement;
use App\Models\Auth\User;
use Illuminate\Foundation\Testing\WithoutEvents;
use Laravel\Sanctum\Sanctum;
use Tests\TestCase;
@@ -16,8 +15,6 @@ use Tests\TestCase;
*/
class AnnouncementRestoreTest extends TestCase
{
use WithoutEvents;
/**
* The Announcement Restore Endpoint shall be protected by sanctum.
*
@@ -11,7 +11,6 @@ use App\Http\Api\Schema\Admin\AnnouncementSchema;
use App\Http\Resources\Admin\Resource\AnnouncementResource;
use App\Models\Admin\Announcement;
use Illuminate\Foundation\Testing\WithFaker;
use Illuminate\Foundation\Testing\WithoutEvents;
use Tests\TestCase;
/**
@@ -20,7 +19,6 @@ use Tests\TestCase;
class AnnouncementShowTest extends TestCase
{
use WithFaker;
use WithoutEvents;
/**
* By default, the Announcement Show Endpoint shall return an Announcement Resource.
@@ -7,7 +7,6 @@ namespace Tests\Feature\Http\Api\Admin\Announcement;
use App\Enums\Auth\CrudPermission;
use App\Models\Admin\Announcement;
use App\Models\Auth\User;
use Illuminate\Foundation\Testing\WithoutEvents;
use Laravel\Sanctum\Sanctum;
use Tests\TestCase;
@@ -16,8 +15,6 @@ use Tests\TestCase;
*/
class AnnouncementStoreTest extends TestCase
{
use WithoutEvents;
/**
* The Announcement Store Endpoint shall be protected by sanctum.
*
@@ -7,7 +7,6 @@ namespace Tests\Feature\Http\Api\Admin\Announcement;
use App\Enums\Auth\CrudPermission;
use App\Models\Admin\Announcement;
use App\Models\Auth\User;
use Illuminate\Foundation\Testing\WithoutEvents;
use Laravel\Sanctum\Sanctum;
use Tests\TestCase;
@@ -16,8 +15,6 @@ use Tests\TestCase;
*/
class AnnouncementUpdateTest extends TestCase
{
use WithoutEvents;
/**
* The Announcement Update Endpoint shall be protected by sanctum.
*
@@ -7,7 +7,6 @@ namespace Tests\Feature\Http\Api\Admin\Dump;
use App\Enums\Auth\CrudPermission;
use App\Models\Admin\Dump;
use App\Models\Auth\User;
use Illuminate\Foundation\Testing\WithoutEvents;
use Laravel\Sanctum\Sanctum;
use Tests\TestCase;
@@ -16,8 +15,6 @@ use Tests\TestCase;
*/
class DumpDestroyTest extends TestCase
{
use WithoutEvents;
/**
* The Dump Destroy Endpoint shall be protected by sanctum.
*

Some files were not shown because too many files have changed in this diff Show More