test(stock): cover aggregate reservation lifecycle

This commit is contained in:
2026-08-25 15:05:29 -03:00
parent 24bfef431b
commit e5f7ba3615
6 changed files with 222 additions and 104 deletions

View File

@@ -12,7 +12,7 @@ use Tests\TestCase;
class ExpireStockReservationsServiceTest extends TestCase
{
public function test_it_expires_purchases_before_abandoned_cart_items(): void
public function test_it_expires_purchases_before_abandoned_cart_reservations(): void
{
$checkout = \Mockery::mock(CheckoutService::class);
$checkout->shouldReceive('expireOverduePurchases')
@@ -36,7 +36,7 @@ class ExpireStockReservationsServiceTest extends TestCase
->with('Stock reservation cleanup completed.', [
'command' => 'reservations:expire',
'expired_purchases' => 2,
'expired_cart_items' => 3,
'expired_cart_reservations' => 3,
'total_expired' => 5,
]);
@@ -44,7 +44,7 @@ class ExpireStockReservationsServiceTest extends TestCase
$this->assertSame([
'purchases' => 2,
'cart_items' => 3,
'cart_reservations' => 3,
], $result);
}
@@ -67,7 +67,7 @@ class ExpireStockReservationsServiceTest extends TestCase
->with('Stock reservation cleanup failed.', [
'command' => 'reservations:expire',
'expired_purchases' => 2,
'expired_cart_items' => null,
'expired_cart_reservations' => null,
'exception' => $exception,
]);