irestful/hack-unit

This package is abandoned and no longer maintained. No replacement package was suggested.

dev-master 2015-06-08 16:12 UTC

This package is not auto-updated.

Last update: 2016-11-17 18:52:50 UTC


README

Build Status HHVM Status

This is a xUnit testing framework written in Hack Lang.

Usage

You need to add this project in your "require" section of your composer.json file.

"require": {
    "irestful/hack-unit": "dev-master"
}

You then need to create a hackunit.json file and put it in the root directory of your project:

{
    "amount_of_logs_per_line": 20,
    "include_scripts": ["./vendor/autoload.php"],
    "suites": [
                {
                    "directory": "./src/HackUnit/Tests/Tests",
                    "file_filter": "(.+)Test.hh"
                }
    ]
}
  • The "directory" is the path where the application will scan for test suites.
  • The "file_filter" is the test suite filter that you must name your test suite classes after.

Creating a Test Suite

Your test suites must extends this class: HackUnit\Infrastructure\Applications\AbstractHackUnitTestApplication

Here's an example of a test suite.

Status

This project is still in beta. To make a release of this project, I need to:

  • Test the application properly.
  • Add support for code coverage.
  • Make it work in strict mode.

Why this project was built?

There was already a project to unit test code written in hack language. However, their API differs dramatically from the PHPUnit API, which was making my code port (from PHP to Hack) a lot harder to execute.

I also needed support for mock objects, which they doesn't currently support. At last, I also had this discussion with the owner of the project and since he planned to re-write his project, and since I had to port my current code from PHP to Hack right away, I decided to work on my own version.

Authors

Steve Rodrigue - steve@irestful.com