the browser-facing portion of osu!
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Move group creation to seeder

nanaya c6c2271b b0b0ce7e

+32 -10
+2
database/seeders/DatabaseSeeder.php
··· 18 18 public function run() 19 19 { 20 20 try { 21 + $this->call(ModelSeeders\GroupSeeder::class); 22 + 21 23 // Miscellaneous Data (e.g. counts) 22 24 $this->call(ModelSeeders\MiscSeeder::class); 23 25
+28
database/seeders/ModelSeeders/GroupSeeder.php
··· 1 + <?php 2 + 3 + // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the GNU Affero General Public License v3.0. 4 + // See the LICENCE file in the repository root for full licence text. 5 + 6 + declare(strict_types=1); 7 + 8 + namespace Database\Seeders\ModelSeeders; 9 + 10 + use App\Models\Group; 11 + use Illuminate\Database\Seeder; 12 + 13 + class GroupSeeder extends Seeder 14 + { 15 + public function run(): void 16 + { 17 + Group::truncate(); 18 + foreach (Group::PRIV_IDENTIFIERS as $identifier) { 19 + Group::create([ 20 + 'group_desc' => '', 21 + 'group_name' => $identifier, 22 + 'group_type' => 2, 23 + 'identifier' => $identifier, 24 + 'short_name' => $identifier, 25 + ]); 26 + } 27 + } 28 + }
+2 -10
tests/SeederExtension.php
··· 8 8 namespace Tests; 9 9 10 10 use App\Models\Group; 11 + use Database\Seeders\ModelSeeders\GroupSeeder; 11 12 use PHPUnit\Runner\AfterLastTestHook; 12 13 use PHPUnit\Runner\BeforeFirstTestHook; 13 14 ··· 23 24 public function executeBeforeFirstTest(): void 24 25 { 25 26 TestCase::withDbAccess(function () { 26 - Group::truncate(); 27 - foreach (Group::PRIV_IDENTIFIERS as $identifier) { 28 - Group::create([ 29 - 'group_desc' => '', 30 - 'group_name' => $identifier, 31 - 'group_type' => 2, 32 - 'identifier' => $identifier, 33 - 'short_name' => $identifier, 34 - ]); 35 - } 27 + (new GroupSeeder())->run(); 36 28 }); 37 29 } 38 30 }