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

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

hhspecify/hhspecify
===================

BDD testing framework for Hack

0.1.2(10y ago)012[2 issues](https://github.com/hhspecify/hhspecify/issues)MITHack

Since Jun 3Pushed 10y agoCompare

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

READMEChangelogDependencies (5)Versions (10)Used By (0)

HHSpecify
=========

[](#hhspecify)

[![Build Status](https://camo.githubusercontent.com/5161f4f5512e57d31acb83742d01955ca67491af5665fecd93eb681eaa731b2b/68747470733a2f2f7472617669732d63692e6f72672f6868737065636966792f6868737065636966792e7376673f6272616e63683d302e312e312d616c70686134)](https://travis-ci.org/hhspecify/hhspecify)

**HHSpecify** is BDD testing framework for [Hack](http://hacklang.org/), inspired by [spock](https://github.com/spockframework/spock).

[![Screen Shot](https://raw.githubusercontent.com/hack-specify/specify/master/screen-shot.png)](https://raw.githubusercontent.com/hack-specify/specify/master/screen-shot.png)

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

[](#installation)

Installed by [composer](https://getcomposer.org/).

```
composer require hhspecify/hhspecify

```

Basic usage
-----------

[](#basic-usage)

### Create a configuration file

[](#create-a-configuration-file)

Create a configuration file in order to verify the specifications.
Use the **configure** method to do the setup.

```
 {

    $package = shape(
        'namespace' => 'vendorname\\spec\\', //The package namespace of the spec
        'packageDirectory' => __DIR__ . '/spec' //The directory of the package spec
    );

    $builder->package($package)
        ->featureReporter(new SpecificationReporter());

});
```

### Create a specification file

[](#create-a-specification-file)

It will create a specification file to **vendorname/spec**.
Specification must implement **hhspecify\\Specification**.

It will specify the specification in the **Feature** attribute.

```
use hhspecify\Specification;
use hhspecify\feature\FeatureVerifierBuilder as Feature;

final class StackSpec implements Specification
{

    public function __construct(
        private Stack $stack = new Stack()
    )
    {
    }

    >
    public function add_value_to_stack(Feature $feature) : void
    {
    }
}
```

### Write a feature specification

[](#write-a-feature-specification)

It will describe the setup / when / then block.
Block specified in lambda expression.

```
>
public function add_value_to_stack(Feature $feature) : void
{
    //setup block - Setup
    $feature->setup(() ==> {
        $this->stack = new Stack();
    });

    //when block - Stimulus
    $feature->when(() ==> {
        $this->stack->add(1);
    });

    //then block - Response
    $feature->then(() ==> {
        invariant($this->stack->count() === 1, 'must have been added value');
    });
}
```

### Verify the specification

[](#verify-the-specification)

In the package root directory run the following command.

```
vendor/bin/hhspecify

```

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

[](#run-the-test)

```
composer install
composer test

```

Run the example
---------------

[](#run-the-example)

```
composer install
composer example

```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity59

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

Recently: every ~29 days

Total

9

Last Release

3883d 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 (233 commits)")

---

Tags

testBDDhhvmhackspec

### Embed Badge

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

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

###  Alternatives

[mockery/mockery

Mockery is a simple yet flexible PHP mock object framework

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

Specification-oriented BDD framework for PHP 7.1+

1.9k36.7M3.1k](/packages/phpspec-phpspec)[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)[php-mock/php-mock-phpunit

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

1718.2M399](/packages/php-mock-php-mock-phpunit)[polishsymfonycommunity/symfony-mocker-container

Provides base Symfony dependency injection container enabling service mocking.

1468.0M237](/packages/polishsymfonycommunity-symfony-mocker-container)[dvdoug/behat-code-coverage

Generate Code Coverage reports for Behat tests

593.6M37](/packages/dvdoug-behat-code-coverage)

PHPackages © 2026

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