From 30dc3755d2cb08902e5de21bb812a18cb363b984 Mon Sep 17 00:00:00 2001 From: "Fabian @ Blax Software" Date: Tue, 2 Jun 2026 09:48:26 +0200 Subject: [PATCH] test: pin clock in loan-vocabulary test; docs: bump suite counts to 1400/3755 PurchaseResourceTest::it_translates_e_commerce_columns_into_loan_vocabulary relied on the real wall clock falling inside the fixture's loan window (2026-05-14..2026-05-28); once that window passed, the loan resolved to `overdue` and the test failed. Freeze the clock inside the window like its sibling tests already do. Update the README test/assertion badges and the Testing section to the current suite size (1400 tests, 3755 assertions) after the subscription-checkout tests. --- README.md | 6 +++--- tests/Unit/Resources/PurchaseResourceTest.php | 4 ++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index b8bd9ec..2eda254 100644 --- a/README.md +++ b/README.md @@ -3,8 +3,8 @@ # Laravel Shop [![Tests](https://github.com/blax-software/laravel-shop/actions/workflows/tests.yml/badge.svg)](https://github.com/blax-software/laravel-shop/actions/workflows/tests.yml) -[![Tests Count](https://img.shields.io/badge/tests-1376%20passing-success?style=flat-square)](#testing) -[![Assertions](https://img.shields.io/badge/assertions-3718-blue?style=flat-square)](#testing) +[![Tests Count](https://img.shields.io/badge/tests-1400%20passing-success?style=flat-square)](#testing) +[![Assertions](https://img.shields.io/badge/assertions-3755-blue?style=flat-square)](#testing) [![Latest Version](https://img.shields.io/packagist/v/blax-software/laravel-shop.svg?style=flat-square)](https://packagist.org/packages/blax-software/laravel-shop) [![License](https://img.shields.io/packagist/l/blax-software/laravel-shop.svg?style=flat-square)](https://packagist.org/packages/blax-software/laravel-shop) [![PHP Version](https://img.shields.io/packagist/php-v/blax-software/laravel-shop.svg?style=flat-square)](https://packagist.org/packages/blax-software/laravel-shop) @@ -192,7 +192,7 @@ booking, Stripe sync and the event surface — so host applications can lean on the behaviour with confidence. ``` -Tests: 1349, Assertions: 3641 +Tests: 1400, Assertions: 3755 ``` CI runs the full suite on every push (see the badge above). To run it diff --git a/tests/Unit/Resources/PurchaseResourceTest.php b/tests/Unit/Resources/PurchaseResourceTest.php index e929714..5ad5dd8 100644 --- a/tests/Unit/Resources/PurchaseResourceTest.php +++ b/tests/Unit/Resources/PurchaseResourceTest.php @@ -45,6 +45,10 @@ class PurchaseResourceTest extends TestCase #[Test] public function it_translates_e_commerce_columns_into_loan_vocabulary(): void { + // Pin "now" inside the loan window so status resolves to active + // regardless of the wall clock (the fixture dates are fixed). + Carbon::setTestNow(Carbon::parse('2026-05-20 10:00:00')); + $loan = $this->loan(); $payload = PurchaseResource::make($loan)->toArray(Request::create('/'));