[TESTS] Specify non-null fields for use of creating actors in tests

This commit is contained in:
Hugo Sales 2022-03-07 00:49:04 +00:00 committed by Diogo Peralta Cordeiro
parent df40dd7c66
commit 808a3b219e
Signed by: diogo
GPG Key ID: 18D2D35001FBFAB0

View File

@ -21,6 +21,7 @@ declare(strict_types = 1);
namespace App\Tests\Core\DB;
use App\Core\ActorLocalRoles;
use App\Core\DB\DB;
use App\Entity\Actor;
use App\Entity\LocalUser;
@ -80,7 +81,7 @@ class DBTest extends GNUsocialTestCase
public function testPersistWithSameId()
{
$actor = Actor::create(['nickname' => 'test', 'bio' => 'some very interesting bio', 'is_local' => false]);
$actor = Actor::create(['nickname' => 'test', 'bio' => 'some very interesting bio', 'is_local' => false, 'roles' => ActorLocalRoles::NONE, 'type' => Actor::PERSON]);
$user = LocalUser::create(['nickname' => 'test']);
$id = DB::persistWithSameId($actor, $user, fn ($id) => $id);
static::assertTrue($id != 0);