Step 11: Running the test suite

FOSCommentBundle comes with both unit and functional tests written using 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.


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

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


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


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.