Fix API suite regressions

This commit is contained in:
Jeppe B
2026-07-08 12:54:26 +02:00
parent 31887fa8c9
commit e14cddc1fb
4 changed files with 9 additions and 4 deletions
+1 -1
View File
@@ -330,7 +330,7 @@ class productsRoute
}
);
}
if ($restrictCustomerBookingProducts) {
if ($restrictCustomerBookingProducts && !$productId) {
$products = $this->filterProductsVisibleOnBookingForm($products);
}
// Return all products, with the department pricing and customer discounts applied
@@ -39,9 +39,7 @@ function order_booking_create_department(string $name): array
function order_booking_create_department_price(int $departmentId, int $productId, int $price): void
{
global $db;
$statement = $db->prepare(
$statement = api_test_runtime()->db()->prepare(
'INSERT INTO `product_department_prices` (`department_id`, `product_id`, `price`)
VALUES (?, ?, ?)
ON DUPLICATE KEY UPDATE `price` = VALUES(`price`)'
@@ -425,10 +425,12 @@ it('edits and deletes only matching customer vehicles through the user-scoped su
], $session['headers']);
$deleted = api_client()->delete(
'/superuser/users/' . $targetUser['id'] . '/vehicles?id=' . $deletableVehicle['id'],
null,
$session['headers']
);
$foreignDelete = api_client()->delete(
'/superuser/users/' . $targetUser['id'] . '/vehicles?id=' . $otherVehicle['id'],
null,
$session['headers']
);
@@ -48,6 +48,11 @@ final class ApiResponse
return $this;
}
public function assertError(): self
{
return $this->assertSuccess(false);
}
public function assertMessage(string $expectedMessage): self
{
$this->assertEnvelope();