diff --git a/tests/integration/extenders/ThrottleApiTest.php b/tests/integration/extenders/ThrottleApiTest.php index a384eeaf71..ffa2886bde 100644 --- a/tests/integration/extenders/ThrottleApiTest.php +++ b/tests/integration/extenders/ThrottleApiTest.php @@ -57,6 +57,9 @@ public function list_discussions_can_be_restricted() return true; } })); + + $this->prepDb(); + $response = $this->send($this->request('GET', '/api/discussions', ['authenticatedAs' => 2])); $this->assertEquals(429, $response->getStatusCode()); @@ -67,16 +70,20 @@ public function list_discussions_can_be_restricted() */ public function false_overrides_true_for_evaluating_throttlers() { - $this->extend((new Extend\ThrottleApi)->set('blockListDiscussions', function ($request) { - if ($request->getAttribute('routeName') === 'discussions.index') { - return true; - } - })); - $this->extend((new Extend\ThrottleApi)->set('blockListDiscussionsOverride', function ($request) { - if ($request->getAttribute('routeName') === 'discussions.index') { - return false; - } - })); + $this->extend( + (new Extend\ThrottleApi)->set('blockListDiscussions', function ($request) { + if ($request->getAttribute('routeName') === 'discussions.index') { + return true; + } + }), + (new Extend\ThrottleApi)->set('blockListDiscussionsOverride', function ($request) { + if ($request->getAttribute('routeName') === 'discussions.index') { + return false; + } + }) + ); + + $this->prepDb(); $response = $this->send($this->request('GET', '/api/discussions', ['authenticatedAs' => 2])); diff --git a/tests/phpunit.integration.xml b/tests/phpunit.integration.xml index 3e1869c9c5..0799fafe5b 100644 --- a/tests/phpunit.integration.xml +++ b/tests/phpunit.integration.xml @@ -6,7 +6,7 @@ convertErrorsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true" - processIsolation="false" + processIsolation="true" stopOnFailure="false">