php - 如何在 testdox 名称中使用大写首字母?

标签 php phpunit

我喜欢 PHPUnit 按照约定自动分解我的测试名称的方式。

public function testValidDataInput()

当我使用 testdox 标志运行时:

phpunit --testdox tests

变成:

PHPUnit 4.8.26 by Sebastian Bergmann and contributors.

MyClass
 [x] Valid data input

但是我在 the documentation 中找不到如何解决首字母大写问题。

public function testValidURLInput()

变成:

MyClass
 [x] Valid u r l input

是否可以让它显示如下:

MyClass
 [x] Valid URL input

最佳答案

您可以使用testValidUrlInput()(这并不是一个好名字,特别是当您想使用TestDox输出时)来获取有效的url输入或者您可以注释您的测试方法使用 @testdox Valid URL input 来获取Valid URL input

关于php - 如何在 testdox 名称中使用大写首字母?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38134504/

相关文章:

php - 如何执行那么长的php Rets?

php - postgresql 最长执行时间

php - 获取所有记录json_encode

php - 单元测试构造函数的最佳方法是什么?

PHPUnit:模拟后包含类

php - 使用 PHP 遍历来自 Yandex API 的 XML 响应

php - 无法获取当前日期的记录

php - 如何在 PHPUnit 中模拟 Doctrine PersistentCollection

php - 如何减少 PHPUnit 和 ZF3 测试中的数据库连接数?

php - 为什么stdClass和匿名类在assertEquals()中表现不同?