2016-06-30 125 views
0

我喜欢PHPUnit按照惯例自动分割测试名称的方式。如何在testdox名称中使用大写字母的首字母缩写?

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 

回答

1

您可以使用testValidUrlInput()(这是不是真的一个好名字,es特别是当你想使用TestDox输出时)得到valid url input或者你可以用@testdox Valid URL input注释你的测试方法得到Valid URL input

+0

'@ testdox'非常完美,谢谢!仍然开始使用PHPUnit,那么为什么'testValidUrlInput'不是一个好名字?你能建议一个更合适的吗? –

+1

因为“有效的网址输入”不是一个完整的句子。 –

+0

我明白了,“验证URL输入”jive也很好吗? –