From c0ae7c492776d599dab56e66e8ed627c4ee44262 Mon Sep 17 00:00:00 2001 From: "Fabian @ Blax Software" Date: Tue, 30 Dec 2025 10:56:03 +0100 Subject: [PATCH] BF pool cart bug, R structure --- tests/Feature/Pool/PoolParkingCartPricingTest.php | 10 +++++----- tests/Feature/Pool/PoolProductPriceIdTest.php | 2 +- tests/Feature/Product/StockAttributesTest.php | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/Feature/Pool/PoolParkingCartPricingTest.php b/tests/Feature/Pool/PoolParkingCartPricingTest.php index 74b9fa2..d0e2d37 100644 --- a/tests/Feature/Pool/PoolParkingCartPricingTest.php +++ b/tests/Feature/Pool/PoolParkingCartPricingTest.php @@ -213,9 +213,9 @@ class PoolParkingCartPricingTest extends TestCase // - 1 cart item with Spot 2 (qty 2): price 500, price_id from pool // - 1 cart item with Spot 3 (qty 2): price 1000, price_id from Spot 3 // Total: 3 cart items - + $this->assertCount(3, $items); - + // First cart item (price 300) should have Spot 1's price_id $item300 = $items->first(fn($i) => $i->price === 300); $this->assertNotNull($item300); @@ -227,7 +227,7 @@ class PoolParkingCartPricingTest extends TestCase $this->assertNotNull($item500); $this->assertEquals(2, $item500->quantity); $this->assertEquals($poolPriceId, $item500->price_id); - + // Cart item with price 1000 should have Spot 3's price_id $spot3PriceId = $spots[2]->defaultPrice()->first()->id; $item1000 = $items->first(fn($i) => $i->price === 1000); @@ -538,9 +538,9 @@ class PoolParkingCartPricingTest extends TestCase // - 1 cart item with Spot 2 (qty 2): price 500, price_id from pool // - 1 cart item with Spot 3 (qty 2): price 500, price_id from pool // Total: 3 cart items - + $this->assertCount(3, $items); - + // First cart item (price 300) should have Spot 1's price_id $item300 = $items->first(fn($i) => $i->price === 300); $this->assertNotNull($item300); diff --git a/tests/Feature/Pool/PoolProductPriceIdTest.php b/tests/Feature/Pool/PoolProductPriceIdTest.php index fbdecf7..9a506b3 100644 --- a/tests/Feature/Pool/PoolProductPriceIdTest.php +++ b/tests/Feature/Pool/PoolProductPriceIdTest.php @@ -139,7 +139,7 @@ class PoolProductPriceIdTest extends TestCase // Check product_id column contains allocated single item id $this->assertNotNull($cartItem->product_id); $this->assertEquals($this->singleItem1->id, $cartItem->product_id); - + // Meta should still have the name for display purposes $meta = $cartItem->getMeta(); $this->assertEquals($this->singleItem1->name, $meta->allocated_single_item_name); diff --git a/tests/Feature/Product/StockAttributesTest.php b/tests/Feature/Product/StockAttributesTest.php index f2607de..a8ca9d6 100644 --- a/tests/Feature/Product/StockAttributesTest.php +++ b/tests/Feature/Product/StockAttributesTest.php @@ -258,7 +258,7 @@ class StockAttributesTest extends TestCase // available_stocks accounts for DECREASE $this->assertEquals(80, $product->available_stocks); - + // max_stocks ignores DECREASE (shows ceiling/capacity) $this->assertEquals(100, $product->max_stocks); }