From 07313a15c464c55fea86f5f05d58b9f66bc63b1a Mon Sep 17 00:00:00 2001 From: Daniel Klabbers Date: Thu, 21 Nov 2019 11:47:01 +0100 Subject: [PATCH] test only on the hidePosts policy ability --- .../api/Controller/ShowDiscussionControllerTest.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/framework/core/tests/integration/api/Controller/ShowDiscussionControllerTest.php b/framework/core/tests/integration/api/Controller/ShowDiscussionControllerTest.php index eb6b35146..c811dc3bb 100644 --- a/framework/core/tests/integration/api/Controller/ShowDiscussionControllerTest.php +++ b/framework/core/tests/integration/api/Controller/ShowDiscussionControllerTest.php @@ -117,7 +117,9 @@ class ShowDiscussionControllerTest extends ApiControllerTestCase $events = app(Dispatcher::class); $events->listen(ScopeModelVisibility::class, function (ScopeModelVisibility $event) { - $event->query->whereRaw('1=1'); + if ($event->ability === 'discussion.hidePosts') { + $event->query->whereRaw('1=1'); + } }); $response = $this->callWith([], ['id' => 4]);