Fix API suite regressions
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user