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

Testing Laravel Package

cartalyst/testing

Cartalyst Testing provides testing utilities for Cartalyst PHP packages, offering base test cases and helpers that simplify mocking, fixtures, and database setup so you can write reliable Laravel and package test suites with less boilerplate.

View on GitHub
Deep Wiki
Context7

PHPUnit helpers and test cases for Platform.

Frequently asked questions about Testing
What is cartalyst/testing used for?
Cartalyst Testing is a Composer package that provides PHPUnit helpers and base test cases for Cartalyst PHP packages, including Platform. It is designed to reduce boilerplate around mocking, fixtures, and database setup so you can write reliable Laravel and package test suites. It is a development dependency, not application runtime code.
How do I install cartalyst/testing with Composer?
Install it as a dev dependency with composer require --dev cartalyst/testing. Check the package composer.json for the version constraint that matches your Laravel and PHP versions. After installation, extend the documented base test case or use the helpers in your existing PHPUnit tests.
Does cartalyst/testing support Laravel 10 and Laravel 11?
Version 5.1.0 adds PHP 8 support, which aligns with the PHP requirements of Laravel 9 and newer, including Laravel 10 and Laravel 11. However, the release note does not publish an explicit Laravel version matrix, so confirm the supported Laravel constraints in composer.json before upgrading. Test your suite on your exact Laravel version in CI.
Which PHP versions does cartalyst/testing v5.1.0 support?
The v5.1.0 release note states that it adds PHP 8 support. It does not clarify whether PHP 7.x support was widened or dropped, so check the composer.json diff to see the exact PHP constraint. Also verify which PHP 8 minors are tested in CI, since PHP 8.0 is end-of-life and 8.1 through 8.3 behave differently.
How do I use the base test cases from cartalyst/testing?
Create your test class and extend the base test case class documented in the package README instead of PHPUnit's TestCase directly. That gives you the package bootstrap, helpers, and conventions for mocking and database setup. If you need custom behavior, override the provided setup methods rather than duplicating bootstrap logic.
Does cartalyst/testing help with mocking and fixtures?
Yes, the package stated purpose is to provide testing utilities that simplify mocking, fixtures, and database setup for Cartalyst packages. The helpers are intended to reduce repetitive boilerplate in your test classes. Check the README for the specific helper methods and any required integration with Mockery or Faker.
How do I set up a database for tests with cartalyst/testing?
The package includes helpers intended to simplify database setup for test suites, but the exact traits and configuration are documented in the README. For fast local runs, pair it with an in-memory SQLite connection or a dedicated test database. Always run migrations and seeders in your test bootstrap so CI matches local behavior.
Should cartalyst/testing be in require or require-dev?
It should be installed in require-dev because it is a testing utility and should not ship in production deployments. Keeping it out of require reduces production dependencies and attack surface. Your CI pipeline should install dev dependencies and run the suite before deployment.
What are alternatives to cartalyst/testing for Laravel package testing?
Common alternatives include extending Laravel's own TestCase with its testing helpers, using orchestra/testbench for package-level Laravel integration, and combining PHPUnit with Mockery and Faker directly. If you are testing Cartalyst Platform packages specifically, cartalyst/testing is the most targeted option.
Is cartalyst/testing actively maintained and how do I upgrade from 5.0 to 5.1?
Treat v5.1.0 as a minor, backward-compatible release, but read the full changelog and composer.json diff rather than relying on the one-line PHP 8 note. In a branch, run composer update cartalyst/testing --with-dependencies, inspect the lockfile diff, and run your full test suite with E_ALL error reporting to catch PHP 8 deprecations. Check the GitHub releases page for maintenance cadence and any known issues under PHP 8.2 and 8.3.
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.
robertmarney/lara-hierarchial-collections
simonschaufi/rule-doc-generator
emissaoja/emissaoja
blackbricksoftware/gravityforms-civicrm-form-processor
al-rahabi/fancy-crud
jinas/dhivatar-component
mltstephane/laravel-quality
bernskiold/laravel-talentlms
bernskioldmedia/laravel-form-architect
youbar/easy-crud
c-point-labs/laravel-hostyourai
dbravoan/dbcms-admin-theme-dbcms
dbravoan/dbcms-theme-db-cyber
dbravoan/dbcms-blocks-basic
dbravoan/dbcms-module-content-audit
dbravoan/dbcms-module-ai-assistant
paygate-to/paygate-php
padosoft/askmydocs-connector-base
defstudio/supercharged-carbon
bernskioldmedia/laravel-matomo