mirror of
https://github.com/flarum/framework.git
synced 2024-11-26 02:10:09 +08:00
Use process isolation for integration tests
This commit is contained in:
parent
720dfceb25
commit
1a49dfc979
|
@ -57,6 +57,9 @@ class ThrottleApiTest extends TestCase
|
|||
return true;
|
||||
}
|
||||
}));
|
||||
|
||||
$this->prepDb();
|
||||
|
||||
$response = $this->send($this->request('GET', '/api/discussions', ['authenticatedAs' => 2]));
|
||||
|
||||
$this->assertEquals(429, $response->getStatusCode());
|
||||
|
@ -67,16 +70,20 @@ class ThrottleApiTest extends TestCase
|
|||
*/
|
||||
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]));
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
convertErrorsToExceptions="true"
|
||||
convertNoticesToExceptions="true"
|
||||
convertWarningsToExceptions="true"
|
||||
processIsolation="false"
|
||||
processIsolation="true"
|
||||
stopOnFailure="false">
|
||||
|
||||
<testsuites>
|
||||
|
|
Loading…
Reference in New Issue
Block a user