testing-domain · git:20260922.00e7bbe · 2026-09-22 · sha256 ca2f77717071c847

testing-domain git:20260922.00e7bbeA

Immutable. This exact content never changes and is served at /api/v1/blob/ca2f77717071c847.

---
name: testing-domain
description: Test Domain behavior and business rules directly.
---

# Testing Domain Behavior

Test Domain rules at the lowest useful level.

Prefer testing behavior through public Domain APIs.

Example:

$order->cancel();

Then assert the resulting Domain state or event.

Do not test implementation details.

Domain tests should not require HTTP requests when the behavior can be tested directly.

Use Laravel database facilities when the Domain model is an Eloquent model and persistence is relevant to the behavior.