From a85b55ec7b87f5501355cd54ec9f143efca42d3b Mon Sep 17 00:00:00 2001 From: Ere Maijala Date: Wed, 2 Oct 2024 09:57:14 +0300 Subject: [PATCH] Add comments. --- .../src/VuFindTest/Mink/BlendedSearchTest.php | 1 + .../integration-tests/src/VuFindTest/Mink/OAuth2Test.php | 1 + .../src/VuFindTest/Mink/SavedSearchesTest.php | 4 +++- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/module/VuFind/tests/integration-tests/src/VuFindTest/Mink/BlendedSearchTest.php b/module/VuFind/tests/integration-tests/src/VuFindTest/Mink/BlendedSearchTest.php index 8ebdd652d2e..6a06c9eb8f6 100644 --- a/module/VuFind/tests/integration-tests/src/VuFindTest/Mink/BlendedSearchTest.php +++ b/module/VuFind/tests/integration-tests/src/VuFindTest/Mink/BlendedSearchTest.php @@ -105,6 +105,7 @@ public function testDisabledSearch() ] ); $session = $this->getMinkSession(); + // We expect an error, so let's act like production mode for realistic testing: $session->setWhoopsDisabled(true); $session->visit($this->getVuFindUrl() . '/Blender/Results'); $page = $session->getPage(); diff --git a/module/VuFind/tests/integration-tests/src/VuFindTest/Mink/OAuth2Test.php b/module/VuFind/tests/integration-tests/src/VuFindTest/Mink/OAuth2Test.php index 75f5d706d4a..2bea3c023f0 100644 --- a/module/VuFind/tests/integration-tests/src/VuFindTest/Mink/OAuth2Test.php +++ b/module/VuFind/tests/integration-tests/src/VuFindTest/Mink/OAuth2Test.php @@ -428,6 +428,7 @@ public function testOAuth2InvalidClient(): void 'state' => $state, ]; $session = $this->getMinkSession(); + // We expect an error, so let's act like production mode for realistic testing: $session->setWhoopsDisabled(true); $session->visit( $this->getVuFindUrl() . '/OAuth2/Authorize?' . http_build_query($params) diff --git a/module/VuFind/tests/integration-tests/src/VuFindTest/Mink/SavedSearchesTest.php b/module/VuFind/tests/integration-tests/src/VuFindTest/Mink/SavedSearchesTest.php index bd477615d0d..e13423680dc 100644 --- a/module/VuFind/tests/integration-tests/src/VuFindTest/Mink/SavedSearchesTest.php +++ b/module/VuFind/tests/integration-tests/src/VuFindTest/Mink/SavedSearchesTest.php @@ -241,6 +241,7 @@ public function testSavedSearchSecurity(): void // Use user A's delete link, but try to execute it as user B: [, $params] = explode('?', $delete); + // We expect an error, so let's act like production mode for realistic testing: $session->setWhoopsDisabled(true); $session->visit($this->getVuFindUrl() . '/MyResearch/SaveSearch?' . $params); $page = $session->getPage(); @@ -253,8 +254,9 @@ public function testSavedSearchSecurity(): void $this->waitForPageLoad($page); $this->findAndAssertLink($page, 'Log Out')->click(); - // Go back in as user A -- see if the saved search still exists. + // Go back to stricter error handling: $session->setWhoopsDisabled(false); + // Go back in as user A -- see if the saved search still exists. $this->findAndAssertLink($page, 'Search History')->click(); $this->clickCss($page, '#loginOptions a'); $this->fillInLoginForm($page, 'username1', 'test');