PHPackages                             lomouty/mock - 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. lomouty/mock

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

lomouty/mock
============

Mock library for php

v0.1.0(7y ago)09MITPHPPHP &gt;=5.3.3

Since Oct 27Pushed 7y ago1 watchersCompare

[ Source](https://github.com/lomouty/vadmock)[ Packagist](https://packagist.org/packages/lomouty/mock)[ RSS](/packages/lomouty-mock/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (3)Used By (0)

lomouty/vadmock
===============

[](#lomoutyvadmock)

This project is a simple library for php to generate mock data with configured mock rules. The mock rules of this project refer to mockjs.

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

[](#installation)

To install this library,run the command blew and you will get the latest version.

```
composer require --dev lomouty/mock
```

Explain
-------

[](#explain)

The current version supports mock in the following formats.

```
integer
string
boolean
object
array
```

Examples
--------

[](#examples)

```
$template = array(
    'number|1-10.1-4' => 1,
    'string|5-20' => '*',
    'boolean|1' => true,
    'object|2-4' => array(
        'test1' => 'abc',
        'test2' => 'def',
        'test3' => 'fggs',
        'test4' => 'gddee',
        'test5' => 'blockkid',
    ),
    'array|1-3' => array(
        'test',
        123,
        false,
        array(
            'tmp1' => 12,
            'tmp2' => 34,
        ),
    ),
);

$res = \Lomouty\Mock\Mock::mock($template);
```

According to the code above, you will get result of array like blew.

```
Array
(
    [number] => 6
    [string] => **********
    [boolean] =>
    [object] => Array
        (
            [test3] => fggs
            [test5] => blockkid
            [test4] => gddee
        )

    [array] => Array
        (
            [0] => test
            [1] => 123
            [2] =>
            [3] => Array
                (
                    [tmp1] => 23
                    [tmp3] => 23
                    [tmp4] => 23
                )

            [4] => 233.3455
            [5] => vtest
        )

)
```

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity47

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.

###  Release Activity

Cadence

Every ~2 days

Total

2

Last Release

2753d ago

### Community

Maintainers

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

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/lomouty-mock/health.svg)

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

###  Alternatives

[phpspec/prophecy

Highly opinionated mocking framework for PHP 5.3+

8.5k551.7M682](/packages/phpspec-prophecy)[vimeo/psalm

A static analysis tool for finding errors in PHP applications

5.8k77.5M6.7k](/packages/vimeo-psalm)[brianium/paratest

Parallel testing for PHP

2.5k118.8M754](/packages/brianium-paratest)[beberlei/assert

Thin assertion library for input validation in business models.

2.4k96.9M570](/packages/beberlei-assert)[mikey179/vfsstream

Virtual file system to mock the real file system in unit tests.

1.4k108.0M2.7k](/packages/mikey179-vfsstream)[orchestra/testbench

Laravel Testing Helper for Packages Development

2.2k39.1M32.1k](/packages/orchestra-testbench)

PHPackages © 2026

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