PHPackages                             usox/hackmock - 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. usox/hackmock

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

usox/hackmock
=============

Mocking framework for hacklang

v1.4.1(5y ago)71.7k7[2 issues](https://github.com/usox/hackmock/issues)4MITHack

Since Jun 2Pushed 5y ago1 watchersCompare

[ Source](https://github.com/usox/hackmock)[ Packagist](https://packagist.org/packages/usox/hackmock)[ Docs](https://github.com/usox/hackmock)[ RSS](/packages/usox-hackmock/feed)WikiDiscussions master Synced 4d ago

READMEChangelog (10)Dependencies (7)Versions (21)Used By (4)

[![Build Status](https://camo.githubusercontent.com/b1d46a2861404d87d2494479a38cf957ec59a7c40a6ec8249b47180a2218d8a5/68747470733a2f2f7472617669732d63692e6f72672f75736f782f6861636b6d6f636b2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/usox/hackmock)

HackMock
========

[](#hackmock)

Creating mock objects for hacklang - yes, seriously.

Note
----

[](#note)

Due to the use of `eval`, hackmock may stop working in future hhvm versions.

What works?
-----------

[](#what-works)

- Strict mode
- Creating mocks of interfaces and concrete classes
- Defining basic method expectations (parameter validation, return value definition)

What does not work?
-------------------

[](#what-does-not-work)

- Everything else, especially rare and/or untested cases involving generics, etc.

```
use function Usox\HackMock\{mock, prospect};

class SomethingTest extends \Usox\HackMock\HackMock {

  public function testSomething() {
    $my_fine_class = mock(SomeInterface::class);

    prospect($my_fine_class, 'someMethodName')
      ->once()
      ->andReturn('some-fine-value');

    prospect($my_fine_class, 'someOtherMethodName')
      ->andThrow(new \Exception('foobar'));
  }
}
```

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance14

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community21

Small or concentrated contributor base

Maturity72

Established project with proven stability

 Bus Factor1

Top contributor holds 85.3% 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 ~53 days

Recently: every ~162 days

Total

19

Last Release

1940d ago

Major Versions

v0.1.8 → v1.0.02018-09-25

### Community

Maintainers

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

---

Top Contributors

[![usox](https://avatars.githubusercontent.com/u/5184763?v=4)](https://github.com/usox "usox (58 commits)")[![ivyhjk](https://avatars.githubusercontent.com/u/12478859?v=4)](https://github.com/ivyhjk "ivyhjk (5 commits)")[![jjergus](https://avatars.githubusercontent.com/u/2483917?v=4)](https://github.com/jjergus "jjergus (3 commits)")[![fredemmott](https://avatars.githubusercontent.com/u/360927?v=4)](https://github.com/fredemmott "fredemmott (1 commits)")[![lexidor](https://avatars.githubusercontent.com/u/31805625?v=4)](https://github.com/lexidor "lexidor (1 commits)")

---

Tags

hackhacklanghhvmmocktestingteststestingmockhhvmhackhacklang

### Embed Badge

![Health badge](/badges/usox-hackmock/health.svg)

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

###  Alternatives

[mockery/mockery

Mockery is a simple yet flexible PHP mock object framework

10.7k497.0M23.6k](/packages/mockery-mockery)[quizlet/hammock

Hammock is a stand-alone mocking library for Hacklang.

27445.5k](/packages/quizlet-hammock)[php-mock/php-mock

PHP-Mock can mock built-in PHP functions (e.g. time()). PHP-Mock relies on PHP's namespace fallback policy. No further extension is needed.

36918.1M98](/packages/php-mock-php-mock)[phake/phake

The Phake mock testing library

4758.0M324](/packages/phake-phake)[kahlan/kahlan

The PHP Test Framework for Freedom, Truth and Justice.

1.2k1.2M247](/packages/kahlan-kahlan)[brain/monkey

Mocking utility for PHP functions and WordPress plugin API

33412.5M350](/packages/brain-monkey)

PHPackages © 2026

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