Skip to content

Commit ed28504

Browse files
[tests-only] port tests to stable #2087 #2039 (#2185)
* [tests-only] test: fix API tests (#2087) * test: use placeholder value Signed-off-by: Saw-jan <saw.jan.grg3e@gmail.com> * test: fix antivirus test expectations Signed-off-by: Saw-jan <saw.jan.grg3e@gmail.com> --------- Signed-off-by: Saw-jan <saw.jan.grg3e@gmail.com> * skip collaborativePosix tests in CI (#2039) --------- Signed-off-by: Saw-jan <saw.jan.grg3e@gmail.com> Co-authored-by: Sawjan Gurung <saw.jan.grg3e@gmail.com>
1 parent 867da07 commit ed28504

6 files changed

Lines changed: 87 additions & 86 deletions

File tree

.woodpecker.star

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,8 @@ config = {
137137
"suites": [
138138
"apiGraph",
139139
"apiServiceAvailability",
140-
"collaborativePosix",
140+
# skip tests for collaborativePosix. see https://github.com/opencloud-eu/opencloud/issues/2036
141+
#"collaborativePosix",
141142
],
142143
"skip": False,
143144
"withRemotePhp": [True],

tests/acceptance/bootstrap/NotificationContext.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ public function filterNotificationsBySubjectAndResource(
377377
}
378378

379379
/**
380-
* @Then /^user "([^"]*)" should (?:get|have) a notification with subject "([^"]*)" and message:$/
380+
* @Then /^user "([^"]*)" should get a notification with subject "([^"]*)" and message:$/
381381
*
382382
* @param string $user
383383
* @param string $subject
@@ -411,10 +411,10 @@ public function userShouldGetANotificationWithMessage(string $user, string $subj
411411
throw new \Exception("Notification was not found even after retrying for 5 seconds.");
412412
}
413413
$expectedMessage = $table->getColumnsHash()[0]['message'];
414-
Assert::assertSame(
414+
Assert::assertStringStartsWith(
415415
$expectedMessage,
416416
$actualMessage,
417-
__METHOD__ . "expected message to be '$expectedMessage' but found'$actualMessage'"
417+
__METHOD__ . "expected message to start with '$expectedMessage' but found'$actualMessage'"
418418
);
419419
}
420420

@@ -441,10 +441,10 @@ public function userShouldGetNotificationForResourceWithMessage(
441441
if (\count($notification) === 1) {
442442
$actualMessage = str_replace(["\r", "\r"], " ", $notification[0]->message);
443443
$expectedMessage = $table->getColumnsHash()[0]['message'];
444-
Assert::assertSame(
444+
Assert::assertStringStartsWith(
445445
$expectedMessage,
446446
$actualMessage,
447-
__METHOD__ . "expected message to be '$expectedMessage' but found'$actualMessage'"
447+
__METHOD__ . "expected message to start with '$expectedMessage' but found'$actualMessage'"
448448
);
449449
$response = $this->userDeletesNotification($user);
450450
$this->featureContext->theHTTPStatusCodeShouldBe(200, '', $response);
@@ -462,7 +462,7 @@ public function userShouldGetNotificationForResourceWithMessage(
462462
}
463463

464464
/**
465-
* @Then user :user should not have a notification related to resource :resource with subject :subject
465+
* @Then user :user should not get a notification related to resource :resource with subject :subject
466466
*
467467
* @param string $user
468468
* @param string $resource

0 commit comments

Comments
 (0)