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:
@@ -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
|
||||
*/
|
||||
|
Reference in New Issue
Block a user