- What is mrgoodbytes8667/test-common used for?
- It is a shared testing foundation for mrgoodbytes Laravel packages. It provides a reusable base TestCase, common assertion methods, and small helpers so test suites stay consistent across projects. The goal is to reduce repeated boilerplate that otherwise gets copied between package repositories.
- How do I install mrgoodbytes8667/test-common with Composer?
- Install it with Composer as a development dependency, since it is a testing package rather than runtime application code. Run composer require --dev mrgoodbytes8667/test-common and let Composer resolve a compatible version for your project. Then extend the provided test case in your own test classes to start using the shared foundation.
- How do I use the base TestCase from this package?
- Extend the package's provided base TestCase from your package's own test classes instead of extending PHPUnit's TestCase directly. That gives your suite access to the shared setup behavior, assertions, and helpers. Start with one or two test classes to confirm the integration before migrating an entire suite.
- What assertions and helpers does mrgoodbytes8667/test-common provide?
- The package supplies common assertions and small helpers intended for Laravel package testing, alongside its reusable base TestCase. The exact list should be checked in the package source and README, since it can evolve with releases. The intent is to cover recurring patterns so each package does not reimplement the same test utilities.
- Is mrgoodbytes8667/test-common a replacement for PHPUnit or Pest?
- No, it is a testing foundation layered on top of your existing test runner rather than a replacement for it. It provides a base TestCase, assertions, and helpers that your PHPUnit or Pest-style tests can build on. You still need a test framework installed and configured in your project.
- Which Laravel versions does mrgoodbytes8667/test-common support?
- The package is built for Laravel package testing, but the supported Laravel and PHP version ranges are defined by its Composer requirements. Check the composer.json constraints for the release you install rather than assuming compatibility with every Laravel version. If you maintain multiple Laravel branches, pin or constrain this dev dependency per branch as needed.
- Can I use this package for application tests or only for Laravel packages?
- It is described as a shared testing foundation for mrgoodbytes Laravel packages, so its primary audience is package test suites. Application test suites may still benefit from the base TestCase and assertions, but the helpers are shaped around package-level testing needs. Evaluate the provided utilities against your application's existing test conventions before adopting it broadly.
- Does mrgoodbytes8667/test-common work with Orchestra Testbench?
- The package is aimed at Laravel package testing, where Orchestra Testbench is a common foundation, but compatibility is not stated in the provided context. Check the package requirements and source to confirm whether its base TestCase integrates with Testbench or assumes a different bootstrap. If it does integrate, you can extend the provided test case and keep Testbench-based package testing conventions.
- Should mrgoodbytes8667/test-common be a dev dependency in composer.json?
- Yes, testing utilities should normally be required with --dev so they are not installed in production deployments. Add it to the require-dev section of your package's composer.json. If you publish a package that other projects install, keep this dependency out of require so consumers do not inherit your test tooling.
- How do I choose between this package and writing my own shared test base class?
- Use this package if you want the mrgoodbytes conventions and helpers without maintaining a duplicated base TestCase across repositories. Write your own base class if your suite needs highly specific bootstrap logic or you want no external dev dependency. You can also start with this package and override or extend behavior locally where your project needs differ.