1
0
mirror of https://github.com/flarum/core.git synced 2025-07-30 21:20:24 +02:00

Remove deprecated policy and visibility scoping events

This commit is contained in:
Alexander Skvortsov
2021-01-20 12:13:40 -05:00
parent a10da427ff
commit e2335e867d
7 changed files with 25 additions and 220 deletions

View File

@@ -118,29 +118,6 @@ class ShowTest extends TestCase
$this->assertEquals(2, Arr::get($json, 'data.relationships.posts.data.0.id'));
}
/**
* @test
*/
public function when_allowed_guests_can_see_hidden_posts()
{
/** @var Dispatcher $events */
$events = $this->app()->getContainer()->make(Dispatcher::class);
$events->listen(ScopeModelVisibility::class, function (ScopeModelVisibility $event) {
if ($event->ability === 'hidePosts') {
$event->query->whereRaw('1=1');
}
});
$response = $this->send(
$this->request('GET', '/api/discussions/4')
);
$json = json_decode($response->getBody()->getContents(), true);
$this->assertEquals(2, Arr::get($json, 'data.relationships.posts.data.0.id'));
}
/**
* @test
*/