diff options
author | Daniel Calviño Sánchez <danxuliu@gmail.com> | 2020-12-03 15:07:54 +0300 |
---|---|---|
committer | Daniel Calviño Sánchez <danxuliu@gmail.com> | 2020-12-07 06:32:00 +0300 |
commit | b553b43b685f03c8a849d272fbcdd0e8189e6edb (patch) | |
tree | 21899820bc535fdaeef52acc7a1f46b9cd73c0d6 /build | |
parent | eab710c2fd6febbf946be3ce8376fb386b61ee90 (diff) |
Make possible to send requests as anonymous users in integration tests
Until now requests always had "auth" headers either for an admin or a
regular user, depending on the value of "currentUser". Now, if
"currentUser" starts by "anonymous" no "auth" header is sent, which
makes possible to also test requests with users not logged in.
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Diffstat (limited to 'build')
-rw-r--r-- | build/integration/features/bootstrap/BasicStructure.php | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/build/integration/features/bootstrap/BasicStructure.php b/build/integration/features/bootstrap/BasicStructure.php index eed0f173ced..2c08d6ff033 100644 --- a/build/integration/features/bootstrap/BasicStructure.php +++ b/build/integration/features/bootstrap/BasicStructure.php @@ -178,7 +178,7 @@ trait BasicStructure { $options = []; if ($this->currentUser === 'admin') { $options['auth'] = $this->adminUser; - } else { + } elseif (strpos($this->currentUser, 'anonymous') !== 0) { $options['auth'] = [$this->currentUser, $this->regularUser]; } $options['headers'] = [ @@ -218,7 +218,7 @@ trait BasicStructure { $options = []; if ($this->currentUser === 'admin') { $options['auth'] = $this->adminUser; - } else { + } elseif (strpos($this->currentUser, 'anonymous') !== 0) { $options['auth'] = [$this->currentUser, $this->regularUser]; } if ($body instanceof TableNode) { |