PHPackages                             mohamedhekal/testharness - 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. [Testing &amp; Quality](/categories/testing)
4. /
5. mohamedhekal/testharness

ActiveLibrary[Testing &amp; Quality](/categories/testing)

mohamedhekal/testharness
========================

Laravel/Pest testing utilities: time travel, queue asserts, API envelope asserts, and lightweight architecture checks

v0.1.0(1mo ago)00MITPHPPHP ^8.2CI passing

Since Jul 16Pushed 1mo agoCompare

[ Source](https://github.com/mohamedhekal/testharness)[ Packagist](https://packagist.org/packages/mohamedhekal/testharness)[ Docs](https://github.com/mohamedhekal/testharness)[ RSS](/packages/mohamedhekal-testharness/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (10)Versions (2)Used By (0)

TestHarness
===========

[](#testharness)

[![CI](https://github.com/mohamedhekal/testharness/actions/workflows/tests.yml/badge.svg)](https://github.com/mohamedhekal/testharness/actions)[![License: MIT](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](LICENSE)[![PHP](https://camo.githubusercontent.com/c2588b5670f2c910b8cc849ace22a22efda8956b7c2f797d11d2096bbfc7b1f5/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e322532422d3737374242342e737667)](https://www.php.net/)[![Laravel](https://camo.githubusercontent.com/b38aa2ff655206bfa9f97c1aeced06f25bb3e31fb085fa974c79934c25469f41/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d313125324631322d4646324432302e737667)](https://laravel.com/)

**Search terms:** laravel, pest, testing, phpunit, queue, architecture, php, laravel-package, test-helpers, time-travel, dev-tools.

Laravel/Pest testing utilities: freeze time, assert queues, assert API envelopes, tenant test bags, and lightweight architecture checks.

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

[](#installation)

```
composer require mohamedhekal/testharness --dev
```

Time travel
-----------

[](#time-travel)

```
use Hekal\TestHarness\Support\TimeTravel;

TimeTravel::freeze('2026-01-15 10:00:00');
TimeTravel::travel(hours: 2);
TimeTravel::back();

$value = withFrozenTime('2026-07-01 08:00:00', fn () => now()->toDateString());
```

Queues
------

[](#queues)

```
Queue::fake();
QueueAssert::assertPushed(MyJob::class, fn (MyJob $job) => $job->id === 1);
```

API envelopes
-------------

[](#api-envelopes)

Compatible with ApiForge-style `{ data, error, meta }`:

```
ApiEnvelopeAssert::assertOk($response);
ApiEnvelopeAssert::assertError($response, 'validation_failed', 422);
```

Architecture
------------

[](#architecture)

```
Architecture::assertStrictTypes(__DIR__.'/../src');
Architecture::assertForbiddenFunctions(__DIR__.'/../src', ['dd', 'dump', 'ray']);
```

Tenant bag
----------

[](#tenant-bag)

```
TenantContext::run(['tenant_id' => 5], function () {
    // compose with your tenancy package inside the callback
});
```

Trait
-----

[](#trait)

```
use Hekal\TestHarness\Concerns\InteractsWithTestHarness;

abstract class TestCase extends \Tests\TestCase
{
    use InteractsWithTestHarness;
}
```

Limitations (v0.1)
------------------

[](#limitations-v01)

- Not a full Pest plugin—helpers + asserts only
- Architecture checks are regex-based, not PHPStan
- Queue asserts require `Queue::fake()` first

Testing
-------

[](#testing)

```
composer install && composer test
```

License
-------

[](#license)

MIT

###  Health Score

34

—

LowBetter than 74% of packages

Maintenance90

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity36

Early-stage or recently created project

 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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

45d ago

### Community

Maintainers

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

---

Top Contributors

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

---

Tags

laravellaravel-packagepestphpphpunittestingphptestingphpunitpestlaravellaravel-packagequeuearchitecturedev-toolstime-traveltest-helpers

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/mohamedhekal-testharness/health.svg)

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

###  Alternatives

[laravel/horizon

Dashboard and code-driven configuration for Laravel queues.

4.2k104.7M370](/packages/laravel-horizon)[psalm/plugin-laravel

Psalm plugin for Laravel

3365.5M359](/packages/psalm-plugin-laravel)[laravel/cashier

Laravel Cashier provides an expressive, fluent interface to Stripe's subscription billing services.

2.5k31.8M166](/packages/laravel-cashier)[spatie/laravel-responsecache

Speed up a Laravel application by caching the entire response

2.8k9.6M77](/packages/spatie-laravel-responsecache)[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k17.6M165](/packages/laravel-pulse)[laravel/mcp

Rapidly build MCP servers for your Laravel applications.

80732.6M270](/packages/laravel-mcp)

PHPackages © 2026

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