diff options
Diffstat (limited to 'tests/integration/features/bootstrap/FeatureContext.php')
-rw-r--r-- | tests/integration/features/bootstrap/FeatureContext.php | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/integration/features/bootstrap/FeatureContext.php b/tests/integration/features/bootstrap/FeatureContext.php index 2881f3b9a..bce4742d8 100644 --- a/tests/integration/features/bootstrap/FeatureContext.php +++ b/tests/integration/features/bootstrap/FeatureContext.php @@ -1089,6 +1089,30 @@ class FeatureContext implements Context, SnippetAcceptingContext { } /** + * @Then /^user "([^"]*)" views URL "([^"]*)" with query parameters and status code (\d+)$/ + * + * @param string $user + * @param string $page + * @param int $statusCode + * @param null|TableNode $formData + */ + public function userViewsURLWithQuery(string $user, string $page, int $statusCode, TableNode $formData = null): void { + $parameters = []; + if ($formData instanceof TableNode) { + foreach ($formData->getRowsHash() as $key => $value) { + $parameters[$key] = $key === 'token' ? (self::$identifierToToken[$value] ?? $value) : $value; + } + } + + $this->setCurrentUser($user); + $this->sendFrontpageRequest( + 'GET', '/' . $page . '?' . http_build_query($parameters) + ); + + $this->assertStatusCode($this->response, $statusCode); + } + + /** * @Then /^user "([^"]*)" sets notifications to (default|disabled|mention|all) for room "([^"]*)" \((v4)\)$/ * * @param string $user |