Search code examples
unit-testinghaxe

Unit test Haxe when targeting PHP


I will use Haxe and the PHP target to develop a blog system. I would like to write it using TDD. Naturally I will use a database. How can it be done?


Solution

  • Here is a working setup using MassiveUnit I did for a pet project:

    ./backend/
    ├── build.hxml
    ├── Dockerfile
    ├── src
    │   ├── Main.hx
    │   └── Stats.hx     # unit under test
    ├── test
    │   ├── StatsTest.hx # a simple test case
    │   ├── TestMain.hx  # tests runner
    │   └── TestSuite.hx # collect tests to execute
    └── test.hxml