PHPackages                             srd2010/testing-tools - 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. srd2010/testing-tools

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

srd2010/testing-tools
=====================

Laravel-specific Testing Helpers and Assertions. Fork for Laravel 10.x

10.0.0(2y ago)0262MITPHPPHP ^8.1

Since Mar 5Pushed 2y agoCompare

[ Source](https://github.com/srd2010/laravel-testing-tools)[ Packagist](https://packagist.org/packages/srd2010/testing-tools)[ RSS](/packages/srd2010-testing-tools/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (5)Versions (3)Used By (2)

[![Laravel-specific Testing Helpers and Assertions](art/1380x575-optimized.jpg)](art/1380x575-optimized.jpg)

Laravel Testing Tools
=====================

[](#laravel-testing-tools)

### This is a fork from the original Repository to support Laravel v10.x

[](#this-is-a-fork-from-the-original-repository-to-support-laravel-v10x)

---

[![Buy Me A Coffee](https://camo.githubusercontent.com/0cf29a542375e1a46e84d8bf5805a4e5c0a6ee98b6547ccdc0c55eed49d99c69/68747470733a2f2f63646e2e6275796d6561636f666665652e636f6d2f627574746f6e732f76322f64656661756c742d79656c6c6f772e706e67)](https://www.buymeacoffee.com/frank.stuhec)

[![StyleCI](https://camo.githubusercontent.com/578db8bff6ae4ab322afe1da73fef006c14762622f33f9c03871600de36b87fb/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3736373336353532302f736869656c643f6272616e63683d6d6173746572)](https://github.styleci.io/repos/767365520?branch=master)[![Build Status](https://camo.githubusercontent.com/4e7e6f0677cfbbddb9b925ca3eb64f367631a5c54813121d072249aca137c85d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f737264323031302f6c61726176656c2d74657374696e672d746f6f6c732f74657374732e796d6c3f6272616e63683d6d6173746572)](https://github.com/srd2010/laravel-testing-tools/actions?query=workflow%3Atests+branch%3Amaster)[![codecov](https://camo.githubusercontent.com/1eeaf67333f9f2e0663d3714dddc62b148ad0540dff6d43c084853f4e99ec913/68747470733a2f2f636f6465636f762e696f2f67682f737264323031302f6c61726176656c2d74657374696e672d746f6f6c732f67726170682f62616467652e7376673f746f6b656e3d4b4e5244335446543652)](https://codecov.io/gh/srd2010/laravel-testing-tools)

[![Packagist Version](https://camo.githubusercontent.com/709a8eb00eb2409463b5d31e8d2f3162aabd58059cdeff121d49ae08e4de6610/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f737264323031302f74657374696e672d746f6f6c73)](https://camo.githubusercontent.com/709a8eb00eb2409463b5d31e8d2f3162aabd58059cdeff121d49ae08e4de6610/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f737264323031302f74657374696e672d746f6f6c73)[![Packagist Stars](https://camo.githubusercontent.com/30fd85f732e83bd19d968ab3b201181e380670a4bcc95ad541e61dd87bb6da9d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f73746172732f737264323031302f74657374696e672d746f6f6c73)](https://camo.githubusercontent.com/30fd85f732e83bd19d968ab3b201181e380670a4bcc95ad541e61dd87bb6da9d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f73746172732f737264323031302f74657374696e672d746f6f6c73)[![Packagist Downloads](https://camo.githubusercontent.com/1e46b647ba80bb2aeeb8ff4fa79025a556c23f5eaf163a5f95949fe3dd476610/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f737264323031302f6c61726176656c2d74657374696e672d746f6f6c73)](https://camo.githubusercontent.com/1e46b647ba80bb2aeeb8ff4fa79025a556c23f5eaf163a5f95949fe3dd476610/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f737264323031302f6c61726176656c2d74657374696e672d746f6f6c73)[![Packagist License](https://camo.githubusercontent.com/25102435c6e552c6c171dba538befc5a79046f9a0a274fb06602d740c7296191/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f737264323031302f74657374696e672d746f6f6c73)](https://camo.githubusercontent.com/25102435c6e552c6c171dba538befc5a79046f9a0a274fb06602d740c7296191/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f737264323031302f74657374696e672d746f6f6c73)

Laravel-specific Testing Helpers and Assertions.

LaravelTesting Tools10.x[10.x](https://github.com/srd2010/laravel-testing-tools/tree/10.x)9.x[9.x](https://github.com/dmitry-ivanov/laravel-testing-tools/tree/9.x)8.x[8.x](https://github.com/dmitry-ivanov/laravel-testing-tools/tree/8.x)7.x[7.x](https://github.com/dmitry-ivanov/laravel-testing-tools/tree/7.x)6.x[6.x](https://github.com/dmitry-ivanov/laravel-testing-tools/tree/6.x)5.8.\*[5.8.\*](https://github.com/dmitry-ivanov/laravel-testing-tools/tree/5.8)5.7.\*[5.7.\*](https://github.com/dmitry-ivanov/laravel-testing-tools/tree/5.7)5.6.\*[5.6.\*](https://github.com/dmitry-ivanov/laravel-testing-tools/tree/5.6)5.5.\*[5.5.\*](https://github.com/dmitry-ivanov/laravel-testing-tools/tree/5.5)5.4.\*[5.4.\*](https://github.com/dmitry-ivanov/laravel-testing-tools/tree/5.4)5.3.\*[5.3.\*](https://github.com/dmitry-ivanov/laravel-testing-tools/tree/5.3)5.2.\*[5.2.\*](https://github.com/dmitry-ivanov/laravel-testing-tools/tree/5.2)5.1.\*[5.1.\*](https://github.com/dmitry-ivanov/laravel-testing-tools/tree/5.1)Usage
-----

[](#usage)

1. Install the package via Composer:

    ```
    composer require --dev srd2010/testing-tools
    ```
2. Use `Illuminated\Testing\TestingTools` trait:

    ```
    use Illuminated\Testing\TestingTools;

    abstract class TestCase extends Illuminate\Foundation\Testing\TestCase
    {
        use TestingTools;

        // ...
    }
    ```
3. Use any of the provided helpers and assertions in your tests:

    ```
    class ExampleTest extends TestCase
    {
        /** @test */
        public function it_has_lots_of_useful_assertions()
        {
            $this->assertDatabaseHasMany('posts', [
                ['title' => 'Awesome!'],
                ['title' => 'Check multiple rows'],
                ['title' => 'In one simple assertion 🤟'],
            ]);
        }
    }
    ```

Available helpers
-----------------

[](#available-helpers)

> Feel free to contribute.

- [ApplicationHelpers](#applicationhelpers)
    - [emulateLocal](#emulatelocal)
    - [emulateProduction](#emulateproduction)
    - [emulateEnvironment](#emulateenvironment)

Available assertions
--------------------

[](#available-assertions)

> Feel free to contribute.

- [CollectionAsserts](#collectionasserts)
    - [assertCollectionsEqual](#assertcollectionsequal)
    - [assertCollectionsNotEqual](#assertcollectionsnotequal)
- [DatabaseAsserts](#databaseasserts)
    - [assertDatabaseHasTable](#assertdatabasehastable)
    - [assertDatabaseMissingTable](#assertdatabasemissingtable)
    - [assertDatabaseHasMany](#assertdatabasehasmany)
    - [assertDatabaseMissingMany](#assertdatabasemissingmany)
- [FilesystemAsserts](#filesystemasserts)
    - [assertDirectoryEmpty](#assertdirectoryempty)
    - [assertDirectoryNotEmpty](#assertdirectorynotempty)
    - [assertFilesCount](#assertfilescount)
    - [assertNotFilesCount](#assertnotfilescount)
- [LogFileAsserts](#logfileasserts)
    - [seeLogFile](#seelogfile)
    - [dontSeeLogFile](#dontseelogfile)
    - [seeInLogFile](#seeinlogfile)
    - [dontSeeInLogFile](#dontseeinlogfile)
- [ScheduleAsserts](#scheduleasserts)
    - [seeScheduleCount](#seeschedulecount)
    - [dontSeeScheduleCount](#dontseeschedulecount)
    - [seeInSchedule](#seeinschedule)
    - [dontSeeInSchedule](#dontseeinschedule)

Helpers
-------

[](#helpers)

### ApplicationHelpers

[](#applicationhelpers)

#### `emulateLocal()`

[](#emulatelocal)

Emulate that application is running on the `local` environment:

```
$this->emulateLocal();
```

#### `emulateProduction()`

[](#emulateproduction)

Emulate that application is running on the `production` environment:

```
$this->emulateProduction();
```

#### `emulateEnvironment()`

[](#emulateenvironment)

Emulate that application is running on the given environment:

```
$this->emulateEnvironment('demo');
```

Assertions
----------

[](#assertions)

### CollectionAsserts

[](#collectionasserts)

#### `assertCollectionsEqual()`

[](#assertcollectionsequal)

Assert that the given collections are equal based on the specified key:

```
$this->assertCollectionsEqual($collection1, $collection2, 'id');
```

#### `assertCollectionsNotEqual()`

[](#assertcollectionsnotequal)

Assert that the given collections are not equal based on the specified key:

```
$this->assertCollectionsNotEqual($collection1, $collection2, 'id');
```

### DatabaseAsserts

[](#databaseasserts)

#### `assertDatabaseHasTable()`

[](#assertdatabasehastable)

Assert that the database has the given table:

```
$this->assertDatabaseHasTable('users');
```

#### `assertDatabaseMissingTable()`

[](#assertdatabasemissingtable)

Assert that the database doesn't have the given table:

```
$this->assertDatabaseMissingTable('unicorns');
```

#### `assertDatabaseHasMany()`

[](#assertdatabasehasmany)

Assert that the database has all the given rows:

```
$this->assertDatabaseHasMany('posts', [
    ['title' => 'First Post'],
    ['title' => 'Second Post'],
    ['title' => 'Third Post'],
]);
```

#### `assertDatabaseMissingMany()`

[](#assertdatabasemissingmany)

Assert that the database doesn't have all the given rows:

```
$this->assertDatabaseMissingMany('posts', [
    ['title' => 'Fourth Post'],
    ['title' => 'Fifth Post'],
]);
```

### FilesystemAsserts

[](#filesystemasserts)

#### `assertDirectoryEmpty()`

[](#assertdirectoryempty)

Assert that the given directory is empty:

```
$this->assertDirectoryEmpty('./my/dir/');
```

#### `assertDirectoryNotEmpty()`

[](#assertdirectorynotempty)

Assert that the given directory is not empty:

```
$this->assertDirectoryNotEmpty('./my/dir/');
```

#### `assertFilesCount()`

[](#assertfilescount)

Assert that directory has the given number of files:

```
$this->assertFilesCount('./my/dir/', 3);
```

#### `assertNotFilesCount()`

[](#assertnotfilescount)

Assert that directory doesn't have the given number of files:

```
$this->assertNotFilesCount('./my/dir/', 5);
```

### LogFileAsserts

[](#logfileasserts)

#### `seeLogFile()`

[](#seelogfile)

Assert that the given log file exists.

The path is relative to the `storage/logs` folder:

```
$this->seeLogFile('example.log');
```

#### `dontSeeLogFile()`

[](#dontseelogfile)

Assert that the given log file doesn't exist.

The path is relative to the `storage/logs` folder:

```
$this->dontSeeLogFile('foobarbaz.log');
```

#### `seeInLogFile()`

[](#seeinlogfile)

Assert that the log file contains the given message.

The path is relative to the `storage/logs` folder:

```
$this->seeInLogFile('example.log', 'Sample log message!');
```

Also, you can specify an array of messages:

```
$this->seeInLogFile('example.log', [
    'Sample log message 1!',
    'Sample log message 2!',
    'Sample log message 3!',
]);
```

You can use these placeholders in messages:

- `%datetime%` - any datetime string.

```
$this->seeInLogFile('example.log', '[%datetime%]: Sample log message!');
```

#### `dontSeeInLogFile()`

[](#dontseeinlogfile)

Assert that the log file doesn't contain the given message.

The path is relative to the `storage/logs` folder:

```
$this->dontSeeInLogFile('example.log', 'Non-existing log message!');
```

Also, you can specify an array of messages:

```
$this->dontSeeInLogFile('example.log', [
    'Non-existing log message 1!',
    'Non-existing log message 2!',
    'Non-existing log message 3!',
]);
```

### ScheduleAsserts

[](#scheduleasserts)

#### `seeScheduleCount()`

[](#seeschedulecount)

Assert that schedule count equals to the given value:

```
$this->seeScheduleCount(3);
```

#### `dontSeeScheduleCount()`

[](#dontseeschedulecount)

Assert that schedule count doesn't equal to the given value:

```
$this->dontSeeScheduleCount(5);
```

#### `seeInSchedule()`

[](#seeinschedule)

Assert that the given command is scheduled:

```
$this->seeInSchedule('foo', 'everyFiveMinutes');
$this->seeInSchedule('bar', 'hourly');
$this->seeInSchedule('baz', 'twiceDaily');
```

Also, you can use cron expressions:

```
$this->seeInSchedule('foo', '*/5 * * * * *');
$this->seeInSchedule('bar', '0 * * * * *');
$this->seeInSchedule('baz', '0 1,13 * * * *');
```

#### `dontSeeInSchedule()`

[](#dontseeinschedule)

Assert that the given command is not scheduled:

```
$this->dontSeeInSchedule('foobarbaz');
```

Original Sponsors
-----------------

[](#original-sponsors)

[![Laravel Idea](art/sponsor-laravel-idea.png)](https://laravel-idea.com)
[![Material Theme UI Plugin](art/sponsor-material-theme.png)](https://material-theme.com)

License
-------

[](#license)

Laravel Testing Tools is open-sourced software licensed under the [MIT license](LICENSE.md).

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 99.7% 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 ~0 days

Total

2

Last Release

804d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/35dd25544a49b40b458160c7f2bfbb2a4891d608df732def49219a83e9e3c9d6?d=identicon)[secondreality](/maintainers/secondreality)

---

Top Contributors

[![dmitry-ivanov](https://avatars.githubusercontent.com/u/1286821?v=4)](https://github.com/dmitry-ivanov "dmitry-ivanov (589 commits)")[![mihan007](https://avatars.githubusercontent.com/u/939122?v=4)](https://github.com/mihan007 "mihan007 (1 commits)")[![StyleCIBot](https://avatars.githubusercontent.com/u/11048387?v=4)](https://github.com/StyleCIBot "StyleCIBot (1 commits)")

---

Tags

testinglaravelhelpersassertionstoolsassertion-methodsassertion-functions

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/srd2010-testing-tools/health.svg)

```
[![Health](https://phpackages.com/badges/srd2010-testing-tools/health.svg)](https://phpackages.com/packages/srd2010-testing-tools)
```

###  Alternatives

[illuminated/testing-tools

Laravel-specific Testing Helpers and Assertions.

5420.4k17](/packages/illuminated-testing-tools)[larastan/larastan

Larastan - Discover bugs in your code without running it. A phpstan/phpstan extension for Laravel

6.4k43.5M5.2k](/packages/larastan-larastan)[orchestra/testbench

Laravel Testing Helper for Packages Development

2.2k39.1M32.1k](/packages/orchestra-testbench)[timacdonald/log-fake

A drop in fake logger for testing with the Laravel framework.

4235.9M56](/packages/timacdonald-log-fake)[sti3bas/laravel-scout-array-driver

Array driver for Laravel Scout

971.5M3](/packages/sti3bas-laravel-scout-array-driver)[davestewart/sketchpad

An innovative front-end environment for interactive Laravel development

29512.9k1](/packages/davestewart-sketchpad)

PHPackages © 2026

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