Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Api Test Cases

Api Test Cases Laravel Package

soft-passio/api-test-cases

Soft Passio API Test Cases is a Laravel package for defining and running API test cases, letting you assert endpoints, responses, status codes, and auth flows so your JSON APIs stay reliable as they grow.

View on GitHub
Deep Wiki
Context7

PHPunit test cases allows you to boost up your workflow with API functional testing.

Frequently asked questions about Api Test Cases
How do I install soft-passio/api-test-cases in a Laravel project?
Install it as a dev-only Composer dependency with composer require soft-passio/api-test-cases --dev. Before merging, check the package's composer.json constraints for php, phpunit/phpunit, and Laravel/Illuminate versions, because the last release is from 2020 and may not resolve on Laravel 10 or 11. Run the install on a branch against one representative service rather than adding it framework-wide.
Does soft-passio/api-test-cases support Laravel 10 and Laravel 11?
Based on its 2020 release and Symfony Bundle-style repository name, soft-passio/api-test-cases is unlikely to support Laravel 10 or Laravel 11 out of the box. Modern apps on PHP 8.2+ and PHPUnit 10/11 should expect Composer constraint failures or setUp signature incompatibilities. Verify with a short branch install, and prefer Laravel's native HTTP test helpers if it does not resolve cleanly.
What Laravel and PHP versions does this package require?
The package belongs to the PHP 7.x and PHPUnit 8–9 era, with no release since June 2020. Its declared php, phpunit/phpunit, and framework constraints are the source of truth, so inspect composer.json before planning any adoption. A modern Laravel app may need a fork or upgraded constraints to use it at all.
How do I write an API test case with soft-passio/api-test-cases?
You typically define a test class, build a request fluently for GET, POST, PUT, PATCH, or DELETE, then chain assertions for status, headers, and JSON paths. Authentication and header helpers let you describe common API flows without repeating boilerplate. The exact method names depend on the package README, so confirm them against the installed version.
What assertions does soft-passio/api-test-cases provide for JSON APIs?
The package offers chainable assertions for HTTP status codes, response headers, JSON structure, and payload values. That overlaps heavily with Laravel's assertStatus, assertHeader, assertJson, and assertJsonStructure helpers. When evaluating it, make sure every chain performs a real assertion so you do not create green tests that verify nothing.
Is soft-passio/api-test-cases maintained and safe for production?
It is a dev-only test dependency, so it does not ship to production and the worst-case blast radius is a broken or misleading test suite. The maintenance risk is real: zero stars, zero dependents, no release in five years, and no community CVE triage. Pin an exact version, fork it internally, or extract the useful patterns into your own base test case.
Can I use soft-passio/api-test-cases with Pest instead of PHPUnit?
Pest runs on top of PHPUnit, so compatibility depends on whether the package's base TestCase and helpers work with the PHPUnit version Pest uses. An older package locked to PHPUnit 8 or 9 may conflict with a modern Pest install on PHPUnit 10 or 11. For new Pest suites, Laravel's built-in HTTP testing helpers are the safer default.
What is the difference between soft-passio/api-test-cases and Laravel's built-in HTTP testing helpers?
Laravel already provides MakesHttpRequests, assertJson*, assertStatus, RefreshDatabase, withoutMiddleware, and Sanctum or Passport helpers for most API testing needs. soft-passio/api-test-cases mainly adds convention and scaffolding: a reusable base test case, a fluent request builder, and auth/header helpers. Run a short spike to compare lines of code and readability against the native helpers before treating it as a standard.
Does soft-passio/api-test-cases handle authentication, headers, and test data?
The package advertises built-in authentication and header helpers plus reusable test data for consistent API coverage. That can reduce repetition for token headers, common request setup, and shared fixtures, but you should verify how it handles sessions, tokens, and factory integration. For Laravel apps using Sanctum or Passport, compare it directly with the first-party testing helpers.
Should I adopt soft-passio/api-test-cases or fork it for an internal package?
For most teams, the better path is to extract the useful conventions into your own tests/Support base test case with no external dependency. If you must use it, fork it under an internal namespace, set your own PHPUnit constraint, pin the exact version, commit the lockfile, add it to dependency scanning, and assign a named owner. Limit adoption to a legacy Laravel 6 or 7 service on PHP 7.4 after a one-to-two-day spike proves measurable value.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource