[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>
This commit is contained in:
Sawjan Gurung
2025-12-30 10:29:09 +05:45
committed by GitHub
parent 0ac473af73
commit 38786ab291
5 changed files with 85 additions and 85 deletions
@@ -377,7 +377,7 @@ class NotificationContext implements Context {
}
/**
* @Then /^user "([^"]*)" should (?:get|have) a notification with subject "([^"]*)" and message:$/
* @Then /^user "([^"]*)" should get a notification with subject "([^"]*)" and message:$/
*
* @param string $user
* @param string $subject
@@ -411,10 +411,10 @@ class NotificationContext implements Context {
throw new \Exception("Notification was not found even after retrying for 5 seconds.");
}
$expectedMessage = $table->getColumnsHash()[0]['message'];
Assert::assertSame(
Assert::assertStringStartsWith(
$expectedMessage,
$actualMessage,
__METHOD__ . "expected message to be '$expectedMessage' but found'$actualMessage'"
__METHOD__ . "expected message to start with '$expectedMessage' but found'$actualMessage'"
);
}
@@ -441,10 +441,10 @@ class NotificationContext implements Context {
if (\count($notification) === 1) {
$actualMessage = str_replace(["\r", "\r"], " ", $notification[0]->message);
$expectedMessage = $table->getColumnsHash()[0]['message'];
Assert::assertSame(
Assert::assertStringStartsWith(
$expectedMessage,
$actualMessage,
__METHOD__ . "expected message to be '$expectedMessage' but found'$actualMessage'"
__METHOD__ . "expected message to start with '$expectedMessage' but found'$actualMessage'"
);
$response = $this->userDeletesNotification($user);
$this->featureContext->theHTTPStatusCodeShouldBe(200, '', $response);
@@ -462,7 +462,7 @@ class NotificationContext implements Context {
}
/**
* @Then user :user should not have a notification related to resource :resource with subject :subject
* @Then user :user should not get a notification related to resource :resource with subject :subject
*
* @param string $user
* @param string $resource