[CORE][TOOL] Minor fixes and run cs-fixer
This commit is contained in:
parent
97243151fa
commit
000ec680e6
@ -36,7 +36,6 @@ declare(strict_types = 1);
|
|||||||
namespace App\Controller;
|
namespace App\Controller;
|
||||||
|
|
||||||
use function App\Core\I18n\_m;
|
use function App\Core\I18n\_m;
|
||||||
use App\Core\VisibilityScope;
|
|
||||||
use App\Util\Common;
|
use App\Util\Common;
|
||||||
use Component\Feed\Feed;
|
use Component\Feed\Feed;
|
||||||
use Component\Feed\Util\FeedController;
|
use Component\Feed\Util\FeedController;
|
||||||
|
@ -46,7 +46,7 @@ class CoreFixtures extends Fixture
|
|||||||
$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', 'is_local' => true]);
|
$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', 'is_local' => false]);
|
$notes[] = Note::create(['actor_id' => $actors['taken_user']->getId(), 'content' => 'private note', 'scope' => VisibilityScope::COLLECTION, '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', 'is_local' => true]);
|
$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);
|
||||||
|
@ -52,7 +52,7 @@ class NoteTest extends GNUsocialTestCase
|
|||||||
$actor2 = DB::findOneBy('actor', ['nickname' => 'taken_group']);
|
$actor2 = DB::findOneBy('actor', ['nickname' => 'taken_group']);
|
||||||
$actor3 = DB::findOneBy('actor', ['nickname' => 'some_user']);
|
$actor3 = DB::findOneBy('actor', ['nickname' => 'some_user']);
|
||||||
|
|
||||||
$note_visible_to_1 = DB::findBy('note', ['actor_id' => $actor1->getId(), 'content' => 'private note', 'scope' => VisibilityScope::SUBSCRIBER], limit: 1)[0];
|
$note_visible_to_1 = DB::findBy('note', ['actor_id' => $actor1->getId(), 'content' => 'private note', 'scope' => VisibilityScope::COLLECTION], limit: 1)[0];
|
||||||
static::assertTrue($note_visible_to_1->isVisibleTo($actor1));
|
static::assertTrue($note_visible_to_1->isVisibleTo($actor1));
|
||||||
static::assertFalse($note_visible_to_1->isVisibleTo($actor2));
|
static::assertFalse($note_visible_to_1->isVisibleTo($actor2));
|
||||||
static::assertFalse($note_visible_to_1->isVisibleTo($actor3));
|
static::assertFalse($note_visible_to_1->isVisibleTo($actor3));
|
||||||
|
Loading…
Reference in New Issue
Block a user