Skip to content

Commit de7ddb6

Browse files
committed
test: Fix recording app state when admin is not the current user
Signed-off-by: Daniel Calviño Sánchez <[email protected]>
1 parent 0ba2f5e commit de7ddb6

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

build/integration/features/bootstrap/Provisioning.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -827,6 +827,9 @@ public function getArrayOfSubadminsResponded($resp) {
827827
* @param string $app
828828
*/
829829
public function appEnabledStateWillBeRestoredOnceTheScenarioFinishes($app) {
830+
$previousUser = $this->currentUser;
831+
$this->currentUser = 'admin';
832+
830833
if (in_array($app, $this->getAppsWithFilter('enabled'))) {
831834
$this->appsToEnableAfterScenario[] = $app;
832835
} elseif (in_array($app, $this->getAppsWithFilter('disabled'))) {
@@ -835,6 +838,8 @@ public function appEnabledStateWillBeRestoredOnceTheScenarioFinishes($app) {
835838

836839
// Apps that were not installed before the scenario will not be
837840
// disabled nor uninstalled after the scenario.
841+
842+
$this->currentUser = $previousUser;
838843
}
839844

840845
private function getAppsWithFilter($filter) {

0 commit comments

Comments
 (0)