Skip to content

Commit 29e93a9

Browse files
authored
Merge pull request #60763 from nextcloud/fix/noid/behat-scenario-state-isolation
test(behat): reset per-scenario state in BasicStructure and Sharing
2 parents 3f7721b + d58e55a commit 29e93a9

2 files changed

Lines changed: 21 additions & 0 deletions

File tree

build/integration/features/bootstrap/BasicStructure.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,18 @@ public function __construct($baseUrl, $admin, $regular_user_password) {
7272
}
7373
}
7474

75+
/**
76+
* @BeforeScenario
77+
*/
78+
public function resetAuthState(): void {
79+
$this->currentUser = '';
80+
$this->currentServer = 'LOCAL';
81+
$this->baseUrl = $this->localBaseUrl;
82+
$this->apiVersion = 1;
83+
$this->requestToken = null;
84+
$this->cookieJar = new CookieJar();
85+
}
86+
7587
/**
7688
* @Given /^using api version "(\d+)"$/
7789
*/

build/integration/features/bootstrap/Sharing.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,15 @@ trait Sharing {
2323
/** @var SimpleXMLElement[] */
2424
private array $storedShareData = [];
2525
private ?string $savedShareId = null;
26+
27+
/**
28+
* @BeforeScenario
29+
*/
30+
public function resetSharingState(): void {
31+
$this->lastShareData = null;
32+
$this->storedShareData = [];
33+
$this->savedShareId = null;
34+
}
2635
/** @var ResponseInterface */
2736
private $response;
2837

0 commit comments

Comments
 (0)