Download the PHP package builtbyberry/laravel-swarm-installer-testkit without Composer

On this page you can find all versions of the php package builtbyberry/laravel-swarm-installer-testkit. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-swarm-installer-testkit

Laravel Swarm Installer Testkit

Shared Testbench-based test harness for <vendor>:install* Artisan command test suites. Extracted from builtbyberry/laravel-swarm so companion packages (builtbyberry/laravel-swarm-pulse and others) can require-dev it directly instead of duplicating the harness.

This package is require-dev-only. It requires orchestra/testbench directly (rather than through a consumer's own require-dev) since testing Artisan installer commands is this package's entire purpose.

What you get

InstallerTestCase is the base test case. Extend it via a small package subclass that supplies your service providers:

Then bind it per test file via the standard Pest uses() call:

On setUp() the harness:

  1. Spins up an Orchestra Testbench application booting the providers your subclass declares.
  2. Materializes a temp directory shaped like a freshly-scaffolded Laravel 13 app — config/, routes/console.php, app/Providers/AppServiceProvider.php, .env, composer.json, plus the usual database/, resources/, storage/, bootstrap/, public/, tests/ directories.
  3. Re-points the running application at the scratch skeleton via $this->app->setBasePath(...) so app_path(), config_path(), base_path(), database_path(), etc. all resolve into the fixture.
  4. Tears the temp directory down in tearDown(). Each test gets its own uniquely-named skeleton — tests are parallel-safe.

Writing an installer test

Idempotency

Every installer should be safe to re-run. The harness has a one-liner:

twice() runs the installer a second time with the same arguments and returns a DoubleRunResult. assertSecondRunIsNoOp() then verifies:

If your installer needs to be re-runnable but has a --force flag that intentionally overwrites, test --force separately — assertSecondRunIsNoOp() is only for the default-mode contract.

Refusal paths

Every installer should fail loudly when its preconditions are violated (unsupported driver, already-installed-and-modified, missing --force, etc.). The refusal helper checks both exit code and error message in one call:

Seeding the skeleton

Many installer scenarios need a pre-existing file in the skeleton — "what does the installer do when config/my-package.php already exists?". Use writeSkeletonFile():

skeletonPath() (no args) returns the absolute root, and skeletonPath('relative/path') resolves a relative path inside it.

Helpers reference

Helper Asserts
runInstaller(string $command, array $arguments = []): InstallerRunResult Invokes the command. Returns a fluent result.
assertInstallerFailsWith(string $command, array $arguments, string $needle): InstallerRunResult Exit code !== 0, output contains the fragment.
assertFileContains(string $relative, string $needle): void Skeleton file exists and contains the fragment.
assertEnvKey(string $key, string $value): void .env defines KEY=value. Tolerates quoting.
assertScheduleEntry(string $name): void routes/console.php registers Schedule::command('<name>'). Tolerates whitespace and quote style.
assertProviderBinding(string $abstract, string $concrete): void AppServiceProvider binds the pair via bind() or singleton(). Matches both Foo::class and 'Foo' reference forms.
writeSkeletonFile(string $relative, string $contents): void Seed a file into the skeleton (parents created as needed).
skeletonPath(string $relative = ''): string Resolve an absolute path inside the skeleton.
snapshotSkeleton(): array<string, string> Hash every file in the skeleton (relative path => sha256). Used internally by assertSecondRunIsNoOp().

InstallerRunResult also exposes:

Registering a command that is not part of your package's default commands()

If you are testing an installer that has not yet been wired into your service provider's commands() method, register it manually:

Once the installer ships in your package's default command list, the registerInstallerCommand() call can be deleted.

Overriding the test environment

defineEnvironment() ships a minimal default (in-memory sqlite, array cache) sufficient for installers that only assert on disk state. Override it in your subclass if your installer needs a connection that survives across PDO instances (queue-worker fakes, subprocess assertions) or other package-specific config.

Why this is a separate package

The harness extends Orchestra\Testbench\TestCase, and orchestra/testbench is a heavy testing framework that has no business in a production composer.lock. Shipping the harness inside a runtime package's own src/ would force either promoting testbench to a production require (bloating every consumer's install) or shipping a class with an undeclared dependency. A standalone require-dev-only package sidesteps both.


All versions of laravel-swarm-installer-testkit with dependencies

PHP Build Version
Package Version
Requires php Version ^8.4
illuminate/console Version ^13.0
illuminate/contracts Version ^13.0
illuminate/filesystem Version ^13.0
illuminate/support Version ^13.0
orchestra/testbench Version ^11.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package builtbyberry/laravel-swarm-installer-testkit contains the following files

Loading the files please wait ...