gpt4 book ai didi

phpunit - Laravel 4 在测试用例中找不到测试

转载 作者:行者123 更新时间:2023-12-03 10:44:18 24 4
gpt4 key购买 nike

我在使用 phpunit 时遇到了一些问题。当我执行测试时,phpunit 给我这些警告:

1) Warning No tests found in class "Illuminate\Foundation\Testing\TestCase".

2) Warning No tests found in class "TestCase".



但我想 忽略 这些文件,以便 phpunit 不会尝试从它们运行测试。

怎么做?

最佳答案

希望现在你找到了答案,但如果你还没有,这可能会有所帮助:

Hmm - make sure that the filenames and class names all match up. Forexample, no FooTest class with a filename of BarTest.php.

Also, are you positive that you have a *Test.php file within theapp/tests directory?

[...]

That was it, i.e. one of my tests had a typo in the filename-vs-classname. Odd that typo kicks a warning in the TestCase classes and instead of flagging the class that actually caused it.


从:
https://laracasts.com/forum/?p=83-warnings-for-testcase-illuminate-foundation-testing-testcase/0
基本上,确保您的文件名和类名匹配。我也在这个问题上敲我的头。

关于phpunit - Laravel 4 在测试用例中找不到测试,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15073140/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com