PHPackages                             hhspecify/hhassert - 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. hhspecify/hhassert

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

hhspecify/hhassert
==================

Simple assertion library for Hack

0.2.0(10y ago)07MITHack

Since Jun 25Pushed 10y agoCompare

[ Source](https://github.com/hhspecify/hhassert)[ Packagist](https://packagist.org/packages/hhspecify/hhassert)[ RSS](/packages/hhspecify-hhassert/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (4)Versions (4)Used By (0)

hhassert
========

[](#hhassert)

**hhassert** is simple assertion library for [Hack](http://hacklang.org/).
You can use easily as assert module of nodejs.

[![Build Status](https://camo.githubusercontent.com/515a12aee453a587a932691a0ee59e987f39ccf8392005b5612e1eaed8e43b3b/68747470733a2f2f7472617669732d63692e6f72672f6868737065636966792f68686173736572742e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/hhspecify/hhassert)[![HHVM Status](https://camo.githubusercontent.com/360be5f485a5cae2e879981e1768d783565f581889bbcdf096ed95cc48e3ef5b/687474703a2f2f6868766d2e683463632e64652f62616467652f6868737065636966792f68686173736572742e737667)](http://hhvm.h4cc.de/package/hhspecify/hhassert)[![Dependency Status](https://camo.githubusercontent.com/4348ba6522eec0e087b6a46f5ea3b355ea95d189d748659756b3ce37a1f38ca5/68747470733a2f2f7777772e76657273696f6e6579652e636f6d2f757365722f70726f6a656374732f3535386239653330333633323332303032313030303030312f62616467652e7376673f7374796c653d666c6174)](https://www.versioneye.com/user/projects/558b9e303632320021000001)

Basic Usage
-----------

[](#basic-usage)

It will specify the **hhassert\\Assert** in the use keyword.

```
use hhassert\Assert;

Assert::ok(1 === 1);      //Passed
Assert::ok("a" === "b");  //Failed

Assert::equal("a", "a");  //Passed
Assert::equal(1, 1);      //Passed
Assert::equal(1.0, 2.0);  //Failed

Assert::notEqual("a", "b"); //Passed
Assert::notEqual("a", "a"); //Failed

Assert::throws(() ==> {
    throw new InvalidArgumentException("exception!!");
}, InvalidArgumentException::class);
```

Custom matcher
--------------

[](#custom-matcher)

You can be the registration of the matcher in the **configure method**. Matcher specified in the lambda expression.

```
Assert::configure((ContextBuilder $builder) ==> {

    $builder->registerMatcher('custom_matcher', (...) ==> {
        list($a, $b) = func_get_args();

        if ($a !== $b) {
            throw new AssertionFailedException("custom matcher");
        }
    });

});

Assert::custom_matcher("a", "b");
```

Run the test
------------

[](#run-the-test)

```
composer install
composer test

```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity55

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

Total

2

Last Release

3981d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/70c299d6d6015ee714954aa05e4d0e9c7b1d31318a5d7db5e9bb4e1f70f78afc?d=identicon)[holyshared](/maintainers/holyshared)

---

Top Contributors

[![holyshared](https://avatars.githubusercontent.com/u/167190?v=4)](https://github.com/holyshared "holyshared (30 commits)")

---

Tags

testasserthhvmSimplehackspec

### Embed Badge

![Health badge](/badges/hhspecify-hhassert/health.svg)

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

###  Alternatives

[quizlet/hammock

Hammock is a stand-alone mocking library for Hacklang.

27445.5k](/packages/quizlet-hammock)[friends-of-phpspec/phpspec-code-coverage

Generate Code Coverage reports for PhpSpec tests

202.6M125](/packages/friends-of-phpspec-phpspec-code-coverage)[elliotchance/concise

Concise is test framework for using plain English and minimal code, built on PHPUnit.

45223.8k4](/packages/elliotchance-concise)[hackpack/hackunit

An xUnit testing framework for Hack

612.7k14](/packages/hackpack-hackunit)[derptest/phpmachinist

Testing object factory for PHP

3636.9k1](/packages/derptest-phpmachinist)[phpmachinist/phpmachinist

Testing object factory for PHP

3630.7k](/packages/phpmachinist-phpmachinist)

PHPackages © 2026

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