• 原文出处:11-running_the_test_suite.md

  • 原文作者:FriendsOfSymfony

  • 授权许可:创作共用协议

  • 翻译人员:FireHare

  • 校对人员:

  • 适用版本:FOSCommentBundle 2.0.5

  • 文章状态:草译阶段

Step 11: Running the test suite

FOSCommentBundle comes with both unit and functional tests written using PHPUnit.

FOSCommentBundle功能包使用PHPUnit来进行单元测试和功能测试。


When contributing to FOSCommentBundle, please provide test coverage for your change and make sure the existing test suite passes before submitting a pull request.

当为FOSCommentBundle功能包贡献时,请为您的改变提供测试覆盖,并确保在提交pull请求之前现有测试套件通过。

Unit and Functional Tests(单元测试和功能测试)

Unit and functional tests both use PHPUnit which has a few requirements to run:

单元测试和功能测试都使用PHPUnit,在运行之前需要:

  • vendors set up by Composer

  • 通过Composer安装Vendors

    • php composer.phar install --dev


  • A PHPUnit installation

  • 安装PHPUnit


Once these dependencies are installed, run the unit test suite by running phpunit in the root bundle directory.

一旦这些依赖被安装,就可以在功能包的根目录中运行phpunit来运行单元测试套件。


PHPUnit will use phpunit.xml.dist provided by FOSCommentBundle. You can customise the test run by copying phpunit.xml.dist to phpunit.xml and making your modifications.

PHPUnit将使用FOSCommentBundle功能包提供的phpunit.xml.dist。您可以将 phpunit.xml.dist 拷贝到  phpunit.xml 中进行修改以实现自定义测试运行。

Travis CI

FOSCommentBundle uses Travis-CI and provides set up in the .travis.yml file. You can enable Travis CI on your fork to get build notifications on any branch you create for a pull request.

FOSCommentBundle功能包使用 Travis-CI 并提供.travis.yml文件进行设置。您可以在您Fork上启用Travis CI,以便在您创建的任何分支中为pull请求得到构建通知。

That is it!

Return to the index.

返回到指南索引页。