File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ APP_NAME = " Trypost.it"
2+ APP_ENV = testing
3+ APP_KEY = base64:oWfTqkX5cJwaVV7c8/z9xjC4XLGzbsKmjSgZiHtvxlk=
4+ APP_DEBUG = true
5+ APP_URL = https://trypost.test
6+
7+ DB_CONNECTION = pgsql
8+ DB_HOST = 127.0.0.1
9+ DB_PORT = 5432
10+ DB_DATABASE = trypost_test
11+ DB_USERNAME = root
12+ DB_PASSWORD =
13+
14+ # Test credentials for social platforms
15+ LINKEDIN_CLIENT_ID = test-linkedin-client-id
16+ LINKEDIN_CLIENT_SECRET = test-linkedin-client-secret
17+
18+ X_CLIENT_ID = test-x-client-id
19+ X_CLIENT_SECRET = test-x-client-secret
20+
21+ TIKTOK_CLIENT_ID = test-tiktok-client-id
22+ TIKTOK_CLIENT_SECRET = test-tiktok-client-secret
23+
24+ FACEBOOK_CLIENT_ID = test-facebook-client-id
25+ FACEBOOK_CLIENT_SECRET = test-facebook-client-secret
26+
27+ INSTAGRAM_CLIENT_ID = test-instagram-client-id
28+ INSTAGRAM_CLIENT_SECRET = test-instagram-client-secret
29+
30+ THREADS_CLIENT_ID = test-threads-client-id
31+ THREADS_CLIENT_SECRET = test-threads-client-secret
32+
33+ GOOGLE_CLIENT_ID = test-google-client-id
34+ GOOGLE_CLIENT_SECRET = test-google-client-secret
35+
36+ PINTEREST_CLIENT_ID = test-pinterest-client-id
37+ PINTEREST_CLIENT_SECRET = test-pinterest-client-secret
38+
39+ UNSPLASH_ACCESS_KEY = test-unsplash-access-key
40+ UNSPLASH_SECRET_KEY = test-unsplash-secret-key
Original file line number Diff line number Diff line change 33namespace App \Models ;
44
55use Illuminate \Database \Eloquent \Concerns \HasUuids ;
6+ use Illuminate \Database \Eloquent \Factories \HasFactory ;
67use Illuminate \Database \Eloquent \Model ;
78use Illuminate \Database \Eloquent \Relations \HasMany ;
89
910class Language extends Model
1011{
11- use HasUuids;
12+ use HasFactory, HasUuids;
1213
1314 protected $ fillable = [
1415 'name ' ,
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Database \Factories ;
4+
5+ use Illuminate \Database \Eloquent \Factories \Factory ;
6+
7+ /**
8+ * @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Language>
9+ */
10+ class LanguageFactory extends Factory
11+ {
12+ /**
13+ * Define the model's default state.
14+ *
15+ * @return array<string, mixed>
16+ */
17+ public function definition (): array
18+ {
19+ return [
20+ 'name ' => 'English ' ,
21+ 'code ' => 'en-US ' ,
22+ ];
23+ }
24+ }
Original file line number Diff line number Diff line change 22
33namespace Database \Factories ;
44
5+ use App \Models \Language ;
56use Illuminate \Database \Eloquent \Factories \Factory ;
67use Illuminate \Support \Facades \Hash ;
78use Illuminate \Support \Str ;
@@ -29,6 +30,7 @@ public function definition(): array
2930 'email_verified_at ' => now (),
3031 'password ' => static ::$ password ??= Hash::make ('password ' ),
3132 'remember_token ' => Str::random (10 ),
33+ 'language_id ' => Language::factory (),
3234 'two_factor_secret ' => null ,
3335 'two_factor_recovery_codes ' => null ,
3436 'two_factor_confirmed_at ' => null ,
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ public function up(): void
1414 Schema::create ('languages ' , function (Blueprint $ table ) {
1515 $ table ->uuid ('id ' )->primary ();
1616 $ table ->string ('name ' );
17- $ table ->string ('code ' )-> unique () ;
17+ $ table ->string ('code ' );
1818 $ table ->timestamps ();
1919 });
2020
Original file line number Diff line number Diff line change 2828 <env name =" QUEUE_CONNECTION" value =" sync" />
2929 <env name =" SESSION_DRIVER" value =" array" />
3030 <env name =" PULSE_ENABLED" value =" false" />
31+ <env name =" FILESYSTEM_DISK" value =" local" />
3132 <env name =" TELESCOPE_ENABLED" value =" false" />
3233 <env name =" NIGHTWATCH_ENABLED" value =" false" />
3334 </php >
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ declare (strict_types=1 );
4+
5+ namespace Tests ;
6+
7+ use Illuminate \Contracts \Console \Kernel ;
8+ use Illuminate \Foundation \Application ;
9+
10+ trait CreatesApplication
11+ {
12+ /**
13+ * Creates the application.
14+ */
15+ public function createApplication (): Application
16+ {
17+ $ app = require __DIR__ .'/../bootstrap/app.php ' ;
18+
19+ $ app ->make (Kernel::class)->bootstrap ();
20+
21+ return $ app ;
22+ }
23+ }
Original file line number Diff line number Diff line change 2020 ->patch (route ('profile.update ' ), [
2121 'name ' => 'Test User ' ,
222223+ 'language_id ' => $ user ->language_id ,
2324 ]);
2425
2526 $ response
4142 ->patch (route ('profile.update ' ), [
4243 'name ' => 'Test User ' ,
4344 'email ' => $ user ->email ,
45+ 'language_id ' => $ user ->language_id ,
4446 ]);
4547
4648 $ response
Original file line number Diff line number Diff line change 88
99abstract class TestCase extends BaseTestCase
1010{
11+ use CreatesApplication;
12+
1113 /**
1214 * Indicates whether the default seeder should run before each test.
1315 *
You can’t perform that action at this time.
0 commit comments