spatie/tabular-assertions
Write readable “tabular assertions” for Pest or PHPUnit by describing expected data as a Markdown-like table and comparing it to actual arrays/collections. Ideal for ordered datasets like time series, financials, or database rows, with clear diffs.
assertEquals($data[0]['name'], 'Pen')) with concise, readable tabular assertions. This reduces cognitive load for developers and QA engineers, especially when testing complex datasets (e.g., financial records, API responses, or database exports)./orders endpoint) with minimal boilerplate.Adopt When:
assertArrayHasKey).Look Elsewhere If:
spatie/data-transfer-object.assertDatabaseHas) that suffices for your needs."This package lets our QA and dev teams validate complex data (like orders, financial records, or API responses) 10x faster by replacing hundreds of lines of repetitive code with simple, readable tables. For example, testing a 20-row dataset drops from 5 minutes of manual assertions to 30 seconds of table-based validation. It’s a low-cost, high-impact tool to reduce bugs in data-heavy workflows, with zero operational overhead—just install and use. Ideal for teams scaling APIs, migrations, or integrations."
*"Spatie’s tabular-assertions gives us Pest/PHPUnit superpowers for testing tabular data. Key wins:
assertEquals($data[0]['price'], 9.99) with a clean Markdown table.composer.json and start using it immediately.
Perfect for API contracts, database syncs, or any test where you’re comparing structured data."*"Imagine writing tests for a /users endpoint that automatically checks 100 rows without copy-pasting assertions. This package does that—plus, it’s self-documenting. Tables are easier to review than nested assert calls, so PRs and onboarding get faster. Try it on your next data-heavy test suite and see the difference."
How can I help you explore Laravel packages today?