PHPackages                             imanghafoori/eloquent-mockery - 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. imanghafoori/eloquent-mockery

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

imanghafoori/eloquent-mockery
=============================

Allows you to design your tests in an independent manner.

v1.0.40(3y ago)127636.4k↓46%18[1 PRs](https://github.com/imanghafoori1/eloquent-mockery/pulls)2MITPHPPHP ^7.2|^8.0

Since Jun 21Pushed 1y ago2 watchersCompare

[ Source](https://github.com/imanghafoori1/eloquent-mockery)[ Packagist](https://packagist.org/packages/imanghafoori/eloquent-mockery)[ Docs](https://github.com/imanghafoori1/eloquent-mockery)[ RSS](/packages/imanghafoori-eloquent-mockery/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (4)Versions (53)Used By (2)

Eloquent Mockery
================

[](#eloquent-mockery)

Mock your eloquent queries without the repository pattern.

[![Required Laravel Version](https://camo.githubusercontent.com/c43218025d03d935f1d4c3163a6baaf2b39aa36608b710ec63056d08033c6de2/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d254532253839254135253230362e302d6666326432303f7374796c653d666c61742d737175617265266c6f676f3d6c61726176656c)](https://packagist.org/packages/imanghafoori/eloquent-mockery)[![Required PHP Version](https://camo.githubusercontent.com/ff110760ba1d6de9119c4599aee70aa0d65137c1a8fcffe539912f723da66b9d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f696d616e676861666f6f72692f6c61726176656c2d6d6963726f73636f70653f636f6c6f723d253233383839324246267374796c653d666c61742d737175617265266c6f676f3d706870)](https://packagist.org/packages/imanghafoori/eloquent-mockery)[![tests](https://github.com/imanghafoori1/eloquent-mockery/actions/workflows/tests.yml/badge.svg?branch=main)](https://github.com/imanghafoori1/eloquent-mockery/actions/workflows/tests.yml)[![Imports](https://github.com/imanghafoori1/eloquent-mockery/actions/workflows/imports.yml/badge.svg?branch=main)](https://github.com/imanghafoori1/eloquent-mockery/actions/workflows/imports.yml)[![Software License](https://camo.githubusercontent.com/d885b3999bb863974fb67118174bb0402d089a89/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e7376673f7374796c653d726f756e642d737175617265)](https://github.com/imanghafoori1/eloquent-mockery/blob/main/LICENSE)

### Why this package was invented?

[](#why-this-package-was-invented)

- It solves the problem of "slow tests" by removing the interactions with a real database.
- It simplifies the process of writing and running tests since your tests will be "DB Independent".

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

[](#installation)

You can **install** the package via Composer:

```
composer require imanghafoori/eloquent-mockery --dev dev-main
```

Usage:
------

[](#usage)

First, you have to define a new connection in your `config/database.php` and set the driver to 'arrayDB'.

```
