- What is Laragear Meta Testing used for?
- Laragear Meta Testing is a lightweight testing companion for Laravel that makes it easier to verify metadata-related behavior in your application or package. It provides expressive assertions for metadata creation, updates, and retrieval, and helps keep those checks readable and maintainable. It works with both PHPUnit and Pest and integrates with Laravel's TestCase and testing helpers.
- How do I install laragear/meta-testing?
- Install it as a development dependency with composer require --dev laragear/meta-testing. Because it is a testing-only package, it should stay in your require-dev graph and CI, not in production dependencies. After installation, extend the provided TestCase or apply its traits to your existing test base.
- Does laragear/meta-testing work with Pest and PHPUnit?
- Yes. The package is designed to work with both PHPUnit and Pest, so you can use the same metadata assertions regardless of your preferred test runner. It integrates with Laravel's TestCase and testing helpers so the assertions fit naturally into existing test suites.
- Which Laravel versions does laragear/meta-testing support?
- Laragear Meta Testing targets modern Laravel releases and is built on top of Orchestra Testbench for package testing. The technical assessment references a PHP 8.x, Laravel 10/11/12, Testbench, and PHPUnit/Pest matrix, so you should confirm the exact constraints in the package's composer.json before upgrading. Version 4.3.0 reports no change to the dependency or version matrix.
- Do I need Orchestra Testbench to use laragear/meta-testing?
- Orchestra Testbench is relevant because the package is aimed at Laravel package authors and sits above Testbench to provide a pre-wired test harness. If you are testing a package, you will typically need Testbench plus a compatible PHPUnit or Pest version. For application-level metadata tests, you can integrate the assertions with Laravel's normal TestCase.
- How do I add metadata assertions to an existing Laravel TestCase?
- You can either extend the TestCase provided by the package or apply its traits to your existing test base class. Since version 4.3.0 removed the @internal tag from its traits, those traits are now a supported extension point. Use them surgically rather than adopting every trait if you want to limit your long-term exit cost.
- Is laragear/meta-testing safe to use in production?
- It is a development-only testing dependency, so it should not be installed as a runtime dependency in production. The assessment notes that it touches only the require-dev graph and CI, which keeps its production blast radius small. Keep it out of production autoloading and rely on it only in your test and CI environments.
- What are alternatives to laragear/meta-testing for Laravel package testing?
- The main alternative is hand-rolled Testbench base classes using Laravel's own testing helpers, which many teams already maintain. Laragear Meta Testing is a convention layer that competes with that default approach by standardizing boilerplate across packages. For a single package, the abstraction cost may exceed the benefit, so compare it against your existing test harness.
- Is laragear/meta-testing actively maintained?
- Version 4.3.0 shows an active 4.x line with small, reviewable changes and a static-analysis gate, which is a positive maintenance signal. However, the package has low external validation with 3 stars and 0 dependents, and it is effectively single-maintainer. Treat it as a useful tool but plan for bus-factor and upstream churn risks.
- Can laragear/meta-testing verify service providers, config merging, and migrations in a Laravel package?
- Yes, its intended role is to assert that a Laravel package integrates correctly with the framework, including service provider registration, auto-discovery, config merging, publishable assets, migrations, routes, commands, translations, and views. It provides a pre-wired harness for those integration checks so your tests are more concise and standardized. Verify the specific assertion coverage you need in the package documentation and your version-matrix spike.