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

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

qlwz/mock
=========

Mock.js for php

1.0.0.0(8y ago)1271[1 PRs](https://github.com/qlwz/mock/pulls)MITPHPPHP &gt;=5.4.0

Since Nov 11Pushed 5y agoCompare

[ Source](https://github.com/qlwz/mock)[ Packagist](https://packagist.org/packages/qlwz/mock)[ RSS](/packages/qlwz-mock/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

Mock
====

[](#mock)

Mock.js for php

翻译Mock.js 到PHP

除了Mock.js 中的 Function 和 RegExp 实现不了外其他方法都已经实现

示例
--

[](#示例)

具体请参考 examples/test.php

```
use qlwz\mock\Mock;

$jsonStr = '{"string|1-10": "★"}';
var_dump(Mock::mock(json_decode($jsonStr)));

$ary = [
    "string|1-10" => "★"
];
var_dump(Mock::mock($ary));

var_dump(Mock::mock('@url'));
```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

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

Unknown

Total

1

Last Release

3107d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4c8ce19d7a1ec17c016429dd50579677870585590600b6b608592cd5f9421015?d=identicon)[qlwz](/maintainers/qlwz)

---

Top Contributors

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

### Embed Badge

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

```
[![Health](https://phpackages.com/badges/qlwz-mock/health.svg)](https://phpackages.com/packages/qlwz-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)
