我无法在我的--filter
脚本中添加composer.json
参数。
我一直在读the docs,但我似乎无法弄明白。
我的composer.json
中有以下脚本
"scripts": {
"test": [
".\\vendor\\bin\\phpunit"
]
},
但我不能发送任何--filters
像:
$ composer test --filter pigeon_ringnumber_cant_be_more_then_9_chars_for_BE_NL_ESP
这会导致以下错误:
[Symfony\Component\Console\Exception\RuntimeException]
The "--filter" option does not exist.
知道如何让脚本接受--filter
参数吗?
我希望能够更快地运行它,然后总是打字
.\\vendor\\bin\\phpunit
这里的关键是仔细阅读文档。在文档中有:
与run-script命令类似,您可以为脚本提供其他参数,例如作曲家测试 - --filter会将--filter传递给phpunit脚本。
所以要通过--filter pigeon_ringnumber_cant_be_more_then_9_chars_for_BE_NL_ESP
你应该运行:
composer test -- --filter pigeon_ringnumber_cant_be_more_then_9_chars_for_BE_NL_ESP
所以你应该在指定你要传递的参数之前使用额外的--
。
当然,在这种情况下,您搜索的解决方案可能会简单得多。你可以考虑creating symbolic link这样做。