createSegment('fetch_base_price_logic'); $this->createConstant($segment, SegmentConstants::BASE_PRICE, [ '2026-03-01' => '10.00', '2026-03-02' => '11.00', '2026-03-05' => '14.00', ]); // A C T $response = $this->actingAsAdmin() ->getJson("/api/v1/segment/{$segment->id}/constant/base-price/show?dateFrom=2026-03-01&dateTo=2026-03-03"); // A S S E R T $response->assertStatus(200); $response->assertJsonPath('payload.data.reference', SegmentConstants::BASE_PRICE); $value = $response->json('payload.data.value'); if (is_string($value)) { $value = json_decode($value, true); } $this->assertSame('10.00', $value['2026-03-01'] ?? null); $this->assertSame('11.00', $value['2026-03-02'] ?? null); $this->assertArrayNotHasKey('2026-03-05', $value); } }