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
Test Foundation

Test Foundation Laravel Package

open-dxp/test-foundation

A testing foundation for Laravel packages, offering base test cases, helper traits, and sensible defaults that bootstrap PHPUnit or Pest suites quickly. It standardizes setup so package authors spend less time wiring scaffolding and more time writing assertions.

View on GitHub
Deep Wiki
Context7

open-dxp/test-foundation supplies a reusable testing foundation for Laravel and PHP packages, so you don't rebuild the same scaffolding in every project. It centralizes the common setup needed to boot a package's service providers, configuration, and environment inside a test run.

Instead of duplicating boilerplate across repositories, extend the provided base classes and start writing meaningful tests. The package keeps test setup consistent, reduces maintenance overhead, and gives teams a shared starting point for package-level testing.

  • Ready-to-use base TestCase with package bootstrapping
  • Reusable assertions and testing helpers
  • Compatible with PHPUnit and Pest
  • Sensible defaults for configuration and environment setup
  • Lightweight, framework-friendly integration
Frequently asked questions about Test Foundation
What is open-dxp/test-foundation used for?
It is the OpenDxp testing library: a testing foundation for Laravel and PHP projects. It provides a shared base test case, reusable assertions, and helper utilities so that PHPUnit or Pest suites can be bootstrapped consistently across packages and applications. Instead of every package re-inventing its own test scaffolding, teams extend the foundation and share one set of conventions.
How do I install open-dxp/test-foundation with Composer?
Install it with Composer from the root of your package or application, for example composer require --dev open-dxp/test-foundation. Because it is a testing library, it belongs in the require-dev section so it is not pulled into production installs. After installation, autoloading is handled by Composer and the base test case becomes available to your suite.
Should open-dxp/test-foundation go in require-dev?
Yes. Testing libraries are only needed while running PHPUnit or Pest, so keep the dependency in require-dev. That way production deployments using composer install --no-dev stay lean and do not ship test-only code. In a monorepo, add it to each package's require-dev or to the shared development dependencies of the root composer.json.
Does open-dxp/test-foundation work with Pest as well as PHPUnit?
Yes. The package is built to support consistent PHPUnit or Pest suites, so you can use whichever runner your project prefers. In PHPUnit you typically extend the provided base test case class, while in Pest you bind that same class as the base test case in your Pest configuration. This keeps behaviour identical regardless of the runner.
How do I use the shared base test case in my own package?
Extend the foundation's base test case from your package's tests, or reference it as the default test case in your Pest configuration file. Your own tests then inherit the shared setup, assertions, and helpers without duplicating boilerplate. Package-specific setup can still be added in your own setUp method, calling the parent implementation as usual.
Can I use open-dxp/test-foundation in a plain PHP project without Laravel?
The library targets Laravel and PHP projects, so it is not limited to full Laravel applications. Plain PHP libraries and packages can use the base test case and helper utilities as long as the required PHP and dependency constraints are met. Laravel-specific behaviour naturally requires a Laravel application or a package bootstrapping tool.
What reusable assertions and helper utilities does it provide?
The package ships reusable assertions and helper utilities that reduce duplicated expectation code across your test suites. The exact set of assertions grows with the library, so check the repository README and source for the current list before relying on a specific helper. The intent is that common checks are written once in the foundation and reused by every package.
Which PHP and Laravel versions are supported?
Supported versions are declared in the package's composer.json, so check the php and illuminate or laravel constraints for the release you plan to install. Match that against your own composer.json before requiring it. If you maintain packages on several framework versions, pin the foundation version that aligns with the oldest Laravel release you still support.
Is open-dxp/test-foundation a replacement for Orchestra Testbench?
No. Orchestra Testbench is the common way to boot a Laravel application inside a package's tests, while this foundation focuses on the shared base test case, assertions, and helper layer. Many Laravel packages will use both: Testbench for application bootstrapping and the foundation for consistent test conventions and assertions. Review the README to confirm how it fits your existing setup.
How does it help keep test suites consistent across packages in a monorepo?
By centralising the base test case, assertions, and helpers in one Composer package, every package in the monorepo extends the same foundation instead of copying setup code. Upgrading test conventions then means bumping a single dependency rather than editing dozens of suites. For release notes and known issues, follow the repository at github.com/open-dxp/test-foundation.
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.
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
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