Merge pull request #60763 from nextcloud/fix/noid/behat-scenario-state-isolation

test(behat): reset per-scenario state in BasicStructure and Sharing
This commit is contained in:
Anna 2026-05-28 09:41:53 +02:00 committed by GitHub
commit 29e93a9550
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 21 additions and 0 deletions

View file

@ -72,6 +72,18 @@ trait BasicStructure {
}
}
/**
* @BeforeScenario
*/
public function resetAuthState(): void {
$this->currentUser = '';
$this->currentServer = 'LOCAL';
$this->baseUrl = $this->localBaseUrl;
$this->apiVersion = 1;
$this->requestToken = null;
$this->cookieJar = new CookieJar();
}
/**
* @Given /^using api version "(\d+)"$/
*/

View file

@ -23,6 +23,15 @@ trait Sharing {
/** @var SimpleXMLElement[] */
private array $storedShareData = [];
private ?string $savedShareId = null;
/**
* @BeforeScenario
*/
public function resetSharingState(): void {
$this->lastShareData = null;
$this->storedShareData = [];
$this->savedShareId = null;
}
/** @var ResponseInterface */
private $response;