mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-11-13 09:42:36 +03:00
Updated uses of user ID to nullify on delete. Added testing to cover deletion of user relations. Added model factories to support changes and potential other tests. Cleans existing ID references in the DB via migration.
30 lines
664 B
PHP
30 lines
664 B
PHP
<?php
|
|
|
|
namespace Database\Factories\Access;
|
|
|
|
use BookStack\Users\Models\User;
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
|
|
/**
|
|
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\BookStack\Access\SocialAccount>
|
|
*/
|
|
class SocialAccountFactory extends Factory
|
|
{
|
|
protected $model = \BookStack\Access\SocialAccount::class;
|
|
|
|
/**
|
|
* Define the model's default state.
|
|
*
|
|
* @return array<string, mixed>
|
|
*/
|
|
public function definition(): array
|
|
{
|
|
return [
|
|
'user_id' => User::factory(),
|
|
'driver' => 'github',
|
|
'driver_id' => '123456',
|
|
'avatar' => '',
|
|
];
|
|
}
|
|
}
|