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

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

sokolnikov911/testing-tools-updated
===================================

Laravel-specific Testing Helpers and Assertions.

10.0.0(2y ago)0191MITPHPPHP ~8.1|~8.2

Since Dec 8Pushed 2y agoCompare

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

READMEChangelogDependencies (5)Versions (102)Used By (1)

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

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

[](#laravel-testing-tools)

Laravel-specific Testing Helpers and Assertions.

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

[](#usage)

1. Install the package via Composer:

    ```
    composer require --dev illuminated/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');
```

License
-------

[](#license)

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

Forked from

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity92

Battle-tested with a long release history

 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 ~26 days

Recently: every ~127 days

Total

101

Last Release

857d ago

Major Versions

7.1.0 → 8.1.02020-12-21

6.x-dev → 7.x-dev2021-01-02

7.x-dev → 8.x-dev2021-03-04

8.x-dev → 9.0.02022-02-19

9.x-dev → 10.x-dev2024-01-10

PHP version history (11 changes)0.1.0PHP &gt;=5.6.4

0.5.1PHP &gt;=5.5.9

5.5.0PHP &gt;=7.0

5.6.0PHP ^7.1.3

6.0.0PHP ^7.2

7.0.0PHP ^7.2.5

8.0.0PHP ^7.3

6.2.0PHP ^7.2.5|^8.0

8.1.0PHP ^7.3|^8.0

9.0.0PHP ^8.0.2

10.x-devPHP ~8.1|~8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/97a1cefec9fcbf213bb9a2db1f26e21b6ccb750984727256dd9833c5b27f25ae?d=identicon)[sokolnikov911](/maintainers/sokolnikov911)

---

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)")[![sokolnikov911](https://avatars.githubusercontent.com/u/11427142?v=4)](https://github.com/sokolnikov911 "sokolnikov911 (1 commits)")

---

Tags

testinglaravelhelpersassertionstoolsassertion-methodsassertion-functions

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  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)
