简单检查 PHPUnit 结果 [英] Simple check of PHPUnit result

查看:57
本文介绍了简单检查 PHPUnit 结果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将 PHPUnit 与其他命令工具结合在一起,我需要一种简单的方法来检查测试是通过还是失败.

I want to to glue PHPUnit with other command tools and I need a simple way to check if the tests passed or failed.

类似的东西

phpunit path_to_folder_containing_the_test

如果全部通过则返回ok",如果任何测试失败则返回failed".

Would return "ok" if all passed or "failed" if any test failed.

[所以我可以简单地从其他工具中检查ok"和failed"值]

[So I can simply check for "ok" and "failed" values from other tools]

推荐答案

我有一个非常简单的 shell 脚本来捕获退出代码,例如:

I have a very simply shell script that capture the exit code like:

>phpunit TestOk.php
>echo $?
0

>phpunit TestKo.php
>echo $?
1

希望对您有帮助

这篇关于简单检查 PHPUnit 结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆