PHPackages                             ez-php/testing-application - 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. [Framework](/categories/framework)
4. /
5. ez-php/testing-application

ActiveLibrary[Framework](/categories/framework)

ez-php/testing-application
==========================

Framework-coupled test base classes for ez-php — ApplicationTestCase, DatabaseTestCase, HttpTestCase

1.11.1(1mo ago)02.6k↓90%20MITPHPPHP ^8.5CI passing

Since Mar 22Pushed 1mo agoCompare

[ Source](https://github.com/ez-php/testing-application)[ Packagist](https://packagist.org/packages/ez-php/testing-application)[ Docs](https://github.com/ez-php/testing-application)[ RSS](/packages/ez-php-testing-application/feed)WikiDiscussions main Synced 3w ago

READMEChangelogDependencies (20)Versions (30)Used By (20)

ez-php/testing-application
==========================

[](#ez-phptesting-application)

Framework-coupled PHPUnit base classes for ez-php applications.

This package provides `ApplicationTestCase`, `DatabaseTestCase`, and `HttpTestCase` — test base classes that boot the full ez-php `Application` stack. It is the framework-aware companion to [`ez-php/testing`](https://github.com/ez-php/testing), which contains the framework-independent utilities (`TestResponse`, `ModelFactory`).

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

[](#installation)

```
composer require --dev ez-php/testing-application
```

Base Classes
------------

[](#base-classes)

### ApplicationTestCase

[](#applicationtestcase)

Bootstraps a fresh `Application` instance before each test.

```
use EzPhp\Testing\ApplicationTestCase;

final class MyTest extends ApplicationTestCase
{
    protected function configureApplication(Application $app): void
    {
        $app->register(MyServiceProvider::class);
    }

    public function testSomething(): void
    {
        $service = $this->app()->make(MyService::class);
        // ...
    }
}
```

### DatabaseTestCase

[](#databasetestcase)

Extends `ApplicationTestCase`. Wraps each test in a database transaction that is rolled back on teardown — no table truncation needed.

```
use EzPhp\Testing\DatabaseTestCase;

final class UserRepositoryTest extends DatabaseTestCase
{
    protected function getBasePath(): string
    {
        // Return path to an app root with config/db.php
    }

    public function testInsert(): void
    {
        $this->pdo()->exec("INSERT INTO users (name) VALUES ('Alice')");
        // rolled back automatically after the test
    }
}
```

### HttpTestCase

[](#httptestcase)

Extends `ApplicationTestCase`. Dispatches fake HTTP requests through the full middleware and routing stack — no HTTP server required.

```
use EzPhp\Testing\HttpTestCase;

final class ApiTest extends HttpTestCase
{
    protected function configureApplication(Application $app): void
    {
        $app->register(ApiRouteProvider::class);
    }

    public function testGetUser(): void
    {
        $this->get('/users/1')->assertOk()->assertJson(['id' => 1]);
    }
}
```

MigrationBootstrap
------------------

[](#migrationbootstrap)

`MigrationBootstrap` runs a set of migrations against a database before a test suite and tears them down after. Useful when `DatabaseTestCase`'s transaction rollback is not enough (e.g. DDL tests or modules that need a schema but not a full application):

```
use EzPhp\Testing\MigrationBootstrap;

// In setUpBeforeClass() / tearDownAfterClass():
MigrationBootstrap::up($pdo, [
    __DIR__ . '/migrations/001_create_users.php',
    __DIR__ . '/migrations/002_create_posts.php',
]);

MigrationBootstrap::down($pdo, [
    __DIR__ . '/migrations/002_create_posts.php',
    __DIR__ . '/migrations/001_create_users.php',
]);
```

Requirements
------------

[](#requirements)

- PHP 8.5+
- ez-php/framework
- ez-php/testing (for `TestResponse`)

###  Health Score

51

—

FairBetter than 95% of packages

Maintenance91

Actively maintained with recent releases

Popularity21

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 88.5% 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.

###  Release Activity

Cadence

Every ~2 days

Total

29

Last Release

43d ago

Major Versions

0.9.3 → 1.0.02026-03-24

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/122030400?v=4)[AU9500](/maintainers/AU9500)[@AU9500](https://github.com/AU9500)

---

Top Contributors

[![AU9500](https://avatars.githubusercontent.com/u/122030400?v=4)](https://github.com/AU9500 "AU9500 (69 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (9 commits)")

---

Tags

phptestingphpunitframeworktest caseez-php

###  Code Quality

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/ez-php-testing-application/health.svg)

```
[![Health](https://phpackages.com/badges/ez-php-testing-application/health.svg)](https://phpackages.com/packages/ez-php-testing-application)
```

###  Alternatives

[pestphp/pest

The elegant PHP Testing Framework.

11.5k67.7M18.9k](/packages/pestphp-pest)

PHPackages © 2026

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