PHPackages                             laradev/test-support - 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. laradev/test-support

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

laradev/test-support
====================

Laravel development test support

0151PHP

Since May 27Pushed 9y ago1 watchersCompare

[ Source](https://github.com/laradevtools/test-support)[ Packagist](https://packagist.org/packages/laradev/test-support)[ RSS](/packages/laradev-test-support/feed)WikiDiscussions master Synced 6d ago

READMEChangelogDependenciesVersions (1)Used By (1)

Laradev Test Support
====================

[](#laradev-test-support)

This package provides helpers and utilities to facilitate testing of Laradev packages.

Install
-------

[](#install)

`composer require --dev laradev/test-support`

Usage
-----

[](#usage)

### Create a test case

[](#create-a-test-case)

Simply extend the class `Laradev\Test\Support\TestCase`.

```
namespace Example

use Laradev\Test\Support\TestCase;

final class ExampleClassTest extends TestCase
{
    /** implement abstract methods **/
}
```

Utilities
---------

[](#utilities)

The `TestCase` embeds a bunch of utilities in the form of traits.
Even if they can be used independently, it is more reliable to extends the `TestCase` class.

### Assertions

[](#assertions)

The `Assertions` trait enhances the `TestCase` class with new assertions directly accessible to `$this`.

- `assertIsSubclassOf(string $expectedParent, string $actual, string $message = '')`: asserts that the actual class is a sub class of a given one.
- `assertBootMergesConfigForProvider(string $providerClass, string $configfile, string $message = '')`: asserts that the `boot` method of a given service provider instance merges the configuration of its package with the main application one.
- `assertBootPublishesConfigForProvider(string $providerClass, string $configfile, string $message = '')`: asserts that the `boot` method of a given service provider instance publishes the configuration file to the application configuration path.

### MockProvider

[](#mockprovider)

The `MockProvider` trait offers a set of factory methods to facilitate the creation of mocks of the main classes of [Laravel](https://laravel.com/).

#### Factory methods

[](#factory-methods)

- `newMock($whatToMock = null)`: returns an instance of `$whatToMock` or of `Mockery\MockInterface` if the argument value is *null*.
- `newAppMock()`: returns an instance of `Illuminate\Contracts\Foundation\Application`.
- `newConfigMock()`: returns an instance of `Illuminate\Contracts\Config\Repository`.
- `newFunctionMock(string $functionName)`: should be used to create a mock of a function, it returns an instance of `Mockery\CompositeExpectation`.
- `newAppContainerWithConfigMock()`: returns an instance of `Illuminate\Contracts\Container\Container` containing a config mock instance that is accessible using the key `config`.

As the mock engine behind the scene is [Mockery](http://docs.mockery.io/en/stable/), all these instances implement the `Mockery\MockInterface` or `Mockery\ExpectationInterface` and then can be enhanced with expectations.

#### Other methods

[](#other-methods)

- `releaseMocks()`: releases all the mocks, does some cleanup.
- `useFunction(string $functionName, ...$args)`: static method to call as the body of a mocked function *(see [MockProviderTest](/tests/unit/Traits/MockProviderTest.php)::testMockingFunctions() for an example on how to do this)*.

> Note:
> While extending the `TestCase` abstract class, the `releaseMocks` method is automatically called at the end of each test in the `tearDown` method.
> If you intend to use the `MockProvider` trait directly, it is important to note that you will need to call the `releaseMocks` method by yourself.

License
-------

[](#license)

This project is licensed under the terms of the [MIT License](/LICENSE)

###  Health Score

20

—

LowBetter than 12% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community9

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/3031a8d556c5dd41f5526cbf74f68ff2d522ad84162f2b8f36691b9f62d61d7c?d=identicon)[eviweb](/maintainers/eviweb)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/laradev-test-support/health.svg)

```
[![Health](https://phpackages.com/badges/laradev-test-support/health.svg)](https://phpackages.com/packages/laradev-test-support)
```

###  Alternatives

[structuraphp/structura

Architectural testing for PHP

141.6k5](/packages/structuraphp-structura)

PHPackages © 2026

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