prolic/humus-phpunit-module

此包已被弃用,不再维护。未建议替代包。

Zend Framework 2 的 PHPUnit 模块

1.1.4 2014-07-07 16:50 UTC

This package is auto-updated.

Last update: 2020-03-09 18:03:10 UTC


README

Build Status Coverage Status Total Downloads Latest Stable Version Latest Unstable Version Dependency Status

Humus PHPUnit Module 是一个用于 Zend Framework 2 的单元测试模块。它可以一次性测试所有您的 zf2 模块和库。

如果您通过 composer 安装此模块,您也会在 vendor 目录中通过 composer 安装 phpunit。您不需要在系统中有一个运行的 PHPUnit 安装,它将作为依赖项安装。

您还可以在 https://github.com/prolic/HumusPHPUnitModuleSampleApp 下载并测试 Humus PHPUnit Module 示例应用程序。

1.2.0 版更新

  • 完整的 ZF2 cli 集成:您可以通过 "php public/index.php humusphpunit" 来启动 humusphpunit。旧的 "vendor/bin/humusphpunit" 方法仍然有效。
  • 支持传递参数到 phpunit,如:"--strict","--debug","--version",等等。
  • 支持 HumusPHPUnitModule 特定的新参数,如:"--modules=" 和 "stop-on-module-failure"。
  • 使用 "php public/index.php" 或 "php public/index.php humusphpunit --help" 来获取可用选项的列表。
  • 控制台输出着色
  • 测试覆盖率

1.1.0 版更新

  • 移除 PHPUnitListener - 注意:这是一个不兼容的更改!!!您必须从现在开始使用模块配置来配置 humus phpunit 模块。
  • 移除对 EHER/PHPUnit 的依赖,因为 PHPUnit 现在自行处理 composer 安装。
  • 移除对完整 Zend Framework 2 的依赖,相反,所需的组件被定义为依赖项。

依赖项

建议

安装

  1. "prolic/humus-phpunit-module": "1.*" 添加到您的 composer.json
  2. 运行 php composer.phar install
  3. 通过在 config/application.config.php 中添加 HumusPHPUnitModulemodules 来启用模块

使用方法

php public/index.php humusphpunit

./vendor/bin/humusphpunit

获取帮助

php public/index.php humusphpunit --help

php public/index.php

配置

示例配置

<?php
return array(
    'humus_phpunit_module' => array(
        'phpunit_runner' => array(
            'Doctrine\Common' => array(
                'vendor/doctrine/common/phpunit.xml.dist'
            )
        )
    )
);