summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/integration/features/bootstrap/FeatureContext.php12
1 files changed, 10 insertions, 2 deletions
diff --git a/tests/integration/features/bootstrap/FeatureContext.php b/tests/integration/features/bootstrap/FeatureContext.php
index 21fb9edda..2ef66eefa 100644
--- a/tests/integration/features/bootstrap/FeatureContext.php
+++ b/tests/integration/features/bootstrap/FeatureContext.php
@@ -106,6 +106,8 @@ class FeatureContext implements Context, SnippetAcceptingContext {
/** @var array */
protected array $changedConfigs = [];
+ protected bool $changedBruteforceSetting = false;
+
private ?SharingContext $sharingContext;
private ?bool $guestsAppWasEnabled = null;
@@ -2972,7 +2974,9 @@ class FeatureContext implements Context, SnippetAcceptingContext {
}
$this->setCurrentUser($currentUser);
- $this->enableDisableBruteForceProtection('disable');
+ if ($this->changedBruteforceSetting) {
+ $this->enableDisableBruteForceProtection('disable');
+ }
}
/**
@@ -3038,7 +3042,9 @@ class FeatureContext implements Context, SnippetAcceptingContext {
* @Given /^(enable|disable) brute force protection$/
*/
public function enableDisableBruteForceProtection(string $enable): void {
- if ($enable === 'disable') {
+ if ($enable === 'enable') {
+ $this->changedBruteforceSetting = true;
+ } else {
// Reset the attempts before disabling
$this->runOcc(['security:bruteforce:reset', '127.0.0.1']);
$this->theCommandWasSuccessful();
@@ -3064,6 +3070,8 @@ class FeatureContext implements Context, SnippetAcceptingContext {
$this->theCommandWasSuccessful();
$this->runOcc(['security:bruteforce:reset', '::1']);
$this->theCommandWasSuccessful();
+ } else {
+ $this->changedBruteforceSetting = false;
}
}