PHPackages                             thecrypticace/suitey - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. thecrypticace/suitey

ActiveLibrary

thecrypticace/suitey
====================

Artisan command to run middleware-like hooks during phpunit tests

027[7 issues](https://github.com/thecrypticace/suitey/issues)PHP

Since Aug 19Pushed 8y ago1 watchersCompare

[ Source](https://github.com/thecrypticace/suitey)[ Packagist](https://packagist.org/packages/thecrypticace/suitey)[ RSS](/packages/thecrypticace-suitey/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Suitey
======

[](#suitey)

Set up the world. Run code before and after PHPUnit.

[![Build Status](https://camo.githubusercontent.com/ce607615c0d1453ae9a38a037b73967f7766715a9f493f9edcc70b59c5c8bd09/68747470733a2f2f7472617669732d63692e6f72672f746865637279707469636163652f7375697465792e737667)](https://travis-ci.org/thecrypticace/suitey)[![Coverage Status](https://camo.githubusercontent.com/d7e472fa50a797b93233c3b2ff336146d60d1f6db9f10e195655916fb57899c6/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f746865637279707469636163652f7375697465792f6d61737465722e737667)](https://codecov.io/github/thecrypticace/suitey?branch=master)[![Total Downloads](https://camo.githubusercontent.com/09c5f7fee3849b3e026b0f52a5fa311f1c80c8d7c15a3325169b05b11e50e0f7/68747470733a2f2f706f7365722e707567782e6f72672f746865637279707469636163652f7375697465792f642f746f74616c2e737667)](https://packagist.org/packages/thecrypticace/suitey)[![Latest Stable Version](https://camo.githubusercontent.com/b273000c98156ad576458fe6b29e3f01d3d1a6bcb141479d97edd754b15c6c86/68747470733a2f2f706f7365722e707567782e6f72672f746865637279707469636163652f7375697465792f762f737461626c652e737667)](https://packagist.org/packages/thecrypticace/suitey)[![License](https://camo.githubusercontent.com/a519f6f35dd36a73637a35d916e7af70f6c2fe895f3bc9e033e634d2a23b3912/68747470733a2f2f706f7365722e707567782e6f72672f746865637279707469636163652f7375697465792f6c6963656e73652e737667)](https://packagist.org/packages/thecrypticace/suitey)

Installation
------------

[](#installation)

1. `composer require thecrypticace/suitey`
2. `php artisan vendor:publish --tag=suitey`
3. Update `steps` list to configure and run the steps you want before your tests.

Usage
-----

[](#usage)

Run your tests with the `test` artisan command:

```
php artisan test

```

This also accepts any parameter that PHPUnit does:

```
php artisan test --filter=my_test_method_name

```

Want to pass arguments to `artisan` before PHPUnit? Use a `--` to separate the two lists:

```
php artisan test -vvv -- --filter=my_test_method_name

```

Adding steps
------------

[](#adding-steps)

When you run `php artisan test` you'll be running one step: PHPUnit. You'll can see this because you will get output that looks like this:

```
[1/1] Run PHPUnit
… test details here …

```

Lets fix that.

### Publishing the config

[](#publishing-the-config)

Run `php artisan vendor:publish --tag=suitey` to publish the config file. This file is where you can detail what steps run and how to load the test environment variables for tests.

### Adding steps

[](#adding-steps-1)

In the config for Suitey you will see a `steps` array that looks like this:

```
"steps" => [
    // \TheCrypticAce\Suitey\MigrateDatabase::class,
    // \TheCrypticAce\Suitey\RefreshDatabase::class,
    // [
    //     "class" => \TheCrypticAce\Suitey\SeedDatabase::class,
    //     "options" => ["class" => "ExampleSeeder"],
    // ]
],
```

Uncomment the `MigrateDatabase` step and your database migrations will run before your tests.

```
"steps" => [
    \TheCrypticAce\Suitey\MigrateDatabase::class,

    // \TheCrypticAce\Suitey\RefreshDatabase::class,
    // [
    //     "class" => \TheCrypticAce\Suitey\SeedDatabase::class,
    //     "options" => ["class" => "ExampleSeeder"],
    // ]
],
```

*Note: You may resolve the class through the container instead of using the facade if your wish.*

Your migrations will now run *before* your test runs. Don't forget to remove the `DatabaseMigrations` trait from your tests.

This step is configurable if your have an atypical setup. You may optionally specify a connection name and/or a path to your migrations.

```
"steps" => [
    [
        "class" => \TheCrypticAce\Suitey\MigrateDatabase::class,
        "options" => ["database" => "connection_name", "path" => "path_to_migrations"],
    ],
],
```

And if you have more than one migration folder:

```
"steps" => [
    [
        "class" => \TheCrypticAce\Suitey\MigrateDatabase::class,
        "options" => ["database" => "foo", "path" => "database/migrations/foo"],
    ],
    [
        "class" => \TheCrypticAce\Suitey\MigrateDatabase::class,
        "options" => ["database" => "bar", "path" => "database/migrations/bar"],
    ],
    [
        "class" => \TheCrypticAce\Suitey\MigrateDatabase::class,
        "options" => ["database" => "baz", "path" => "database/migrations/baz"],
    ],
],
```

Available Steps
---------------

[](#available-steps)

ClassConfig OptionDescription`MigrateDatabase`Migrate a database via `migrate` and `migrate:rollback` before/after phpunitdatabase*optional* The default connection to use during migrationpath*optional*The path to your migration files`RefreshDatabase`Refresh a database via `migrate:refresh` before starting phpunitdatabase*optional*The default connection to use during migrationpath*optional*The path to your migration files`SeedDatabase`Run the given seeder before starting PHPUnitname*required* The name of the seeder you would like to run`RunCode`Run a closure!name*required* The name displayed to the user. This can be a closure that determines the name if needed.code*required* The code to runWant to see something meta?
---------------------------

[](#want-to-see-something-meta)

Suitey can run its own tests: `./tests/Fixture/artisan test`

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/ad7d84b718d409800d572754ba2b4ce21ed67f7022e995b228f354030c3274b8?d=identicon)[thecrypticace](/maintainers/thecrypticace)

---

Top Contributors

[![thecrypticace](https://avatars.githubusercontent.com/u/614993?v=4)](https://github.com/thecrypticace "thecrypticace (81 commits)")

### Embed Badge

![Health badge](/badges/thecrypticace-suitey/health.svg)

```
[![Health](https://phpackages.com/badges/thecrypticace-suitey/health.svg)](https://phpackages.com/packages/thecrypticace-suitey)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
