Search by

monkeyscloud / monkeyslegion-testing

yorchperaza

Testing toolkit for MonKeysLegion — HTTP testing DSL, database traits, fake subsystems, snapshots.

Package info

github.com/MonkeysCloud/monkeyslegion-testing

pkg:composer/monkeyscloud/monkeyslegion-testing

Statistics

Installs: 11

Dependents: 2

Suggesters: 0

Stars: 0

Open Issues: 0

1.0.1 2026-09-29 01:50 UTC

This package is auto-updated.

Last update: 2026-09-29 01:54:40 UTC


README

Testing toolkit for the MonKeysLegion framework — HTTP testing DSL, database traits, fake subsystems, and snapshot assertions.

Features

  • HTTP testing DSL — get(), post(), put(), delete() with fluent assertions
  • TestResponse — assertStatus(), assertJson(), assertJsonPath(), assertHeader()
  • Database traits — RefreshDatabase, DatabaseTransactions, InteractsWithDatabase
  • Fake subsystems — QueueFake, MailFake, EventFake with assertion methods
  • Snapshot testing — assertMatchesSnapshot() for view/JSON/XML output
  • Fixture loader — load test data from JSON/PHP fixture files
  • Pest adapter — Pest PHP compatibility layer
  • Auth testing — actingAs(), InteractsWithAuth trait

Installation

composer require --dev monkeyscloud/monkeyslegion-testing

Usage

use MonkeysLegion\Testing\TestCase;
use MonkeysLegion\Testing\Concerns\RefreshDatabase;

final class UserApiTest extends TestCase
{
    use RefreshDatabase;

    public function test_create_user(): void
    {
        $response = $this->post('/api/users', [
            'name' => 'Bob',
            'email' => 'bob@example.com',
        ]);

        $response->assertStatus(201);
        $response->assertJsonPath('data.name', 'Bob');
    }
}

License

MIT © MonKeysCloud