[TESTS] Add missing 'is_local' to actors in data fixtures

This commit is contained in:
Hugo Sales 2021-11-23 21:35:25 +00:00 committed by Diogo Peralta Cordeiro
parent 206856e1ba
commit 30f4131f5d
Signed by: diogo
GPG Key ID: 18D2D35001FBFAB0

View File

@ -29,7 +29,7 @@ class CoreFixtures extends Fixture
'form_account_test_user' => [LocalUser::class, 'setId', ['password' => LocalUser::hashPassword('some password')]], 'form_account_test_user' => [LocalUser::class, 'setId', ['password' => LocalUser::hashPassword('some password')]],
'taken_group' => [LocalGroup::class, 'setGroupId', []], 'taken_group' => [LocalGroup::class, 'setGroupId', []],
] as $nick => [$entity, $method, $extra_create]) { ] as $nick => [$entity, $method, $extra_create]) {
$actor = Actor::create(['nickname' => $nick]); $actor = Actor::create(['nickname' => $nick, 'is_local' => true]);
$manager->persist($actor); $manager->persist($actor);
$ent = $entity::create(array_merge(['nickname' => $nick], $extra_create)); // cannot use array spread for arrays with string keys $ent = $entity::create(array_merge(['nickname' => $nick], $extra_create)); // cannot use array spread for arrays with string keys
$ent->{$method}($actor->getId()); $ent->{$method}($actor->getId());
@ -40,12 +40,12 @@ class CoreFixtures extends Fixture
$actors[$nick] = $actor; $actors[$nick] = $actor;
} }
$n = Note::create(['actor_id' => $actors['taken_user']->getId(), 'content' => 'some content', 'content_type' => 'text/plain']); $n = Note::create(['actor_id' => $actors['taken_user']->getId(), 'content' => 'some content', 'content_type' => 'text/plain', 'is_local' => true]);
$manager->persist($n); $manager->persist($n);
$notes = []; $notes = [];
$notes[] = Note::create(['actor_id' => $actors['taken_user']->getId(), 'content' => 'some other content', 'content_type' => 'text/plain']); $notes[] = Note::create(['actor_id' => $actors['taken_user']->getId(), 'content' => 'some other content', 'content_type' => 'text/plain', 'is_local' => true]);
$notes[] = Note::create(['actor_id' => $actors['taken_user']->getId(), 'content' => 'private note', 'scope' => VisibilityScope::SUBSCRIBER, 'content_type' => 'text/plain']); $notes[] = Note::create(['actor_id' => $actors['taken_user']->getId(), 'content' => 'private note', 'scope' => VisibilityScope::SUBSCRIBER, 'content_type' => 'text/plain', 'is_local' => false]);
$notes[] = $group_note = Note::create(['actor_id' => $actors['taken_user']->getId(), 'content' => 'group note', 'scope' => VisibilityScope::GROUP, 'content_type' => 'text/plain']); $notes[] = $group_note = Note::create(['actor_id' => $actors['taken_user']->getId(), 'content' => 'group note', 'scope' => VisibilityScope::GROUP, 'content_type' => 'text/plain', 'is_local' => true]);
foreach ($notes as $note) { foreach ($notes as $note) {
$manager->persist($note); $manager->persist($note);
} }