Running phpunit tests using HHVM (HipHop)

前端 未结 3 1434
误落风尘
误落风尘 2021-02-20 16:29

I am trying to run PHPUnit unit tests via HHVM on a virtual Ubuntu 12.04 (64-bit Server) install. The tests usually run using a phpunit.xml file located in my tests directory, w

3条回答
  •  感动是毒
    2021-02-20 16:56

    HHVM 2.4+

    HHVM 2.4.0 was just released and it came with full phpunit support! Just give the full path to phpunit binary, like this:

    $ hhvm /usr/bin/phpunit
    

    Cheers!


    HHVM 2.3

    Tested this step by step guide from HHVM wiki and it works. Here is a simplified guide:

    On your project, add the following entries to your composer.json file:

    "require-dev": {
        "phpunit/phpunit": "3.7.*",
        "phpunit/php-invoker": "1.1.3",
        "phpunit/dbunit": "1.2.3",
        "phpunit/phpunit-selenium": "1.3.2",
        "phpunit/phpunit-story": "1.0.2"
    }
    
    1. Run hhvm composer.phar install --dev. If you did a composer system wide install, run hhvm /usr/local/bin/composer install --dev, it works too.

    2. A vendor directory will be created. The phpunit "binary" will be located at vendor/bin/phpunit

    3. To run PHPUnit for your project: hhvm vendor/bin/phpunit [optional arguments]

    Note: Probably in a not so distant future hhvm /usr/local/bin/phpunit [optional arguments] will work as expected, but right now this is the easiest option we have

提交回复
热议问题