Laravel - RuntimeException - Could not scan for classes inside “app/tests/TestCase.php”

限于喜欢 提交于 2019-12-21 07:28:09

问题


I've been using Laravel to display a custom blog for a month or so now and it's been working perfectly.

I just took a look at my site and it's saying:

/vendor/symfony/security/Symfony/Component/Security/Core/Util/SecureRandom.php): failed to open stream: No such file or directory

Having looked in the folders the location of the above file is actually:

/vendor/symfony/security-core/Symfony/Component/Security/Core/Util/SecureRandom.php): failed to open stream: No such file or directory

but I haven't changed this?

If I try and run composer update I get this error:

root@server [/laravel]# composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Writing lock file
Generating autoload files

  [RuntimeException]
  Could not scan for classes inside "app/tests/TestCase.php" which does not appear to be a file nor a folder

Any ideas what's causing this or how I should go about fixing / debugging it?


回答1:


Do you have a app/tests/TestCase.php file on your production server?

If not - you should remove it from composer.json (or put the file back there)




回答2:


I have same problem facing in Laravel 5.1, But is resolved now. Solution is : only test directory and files are in root directory structure. Other wise we removed in composer.json.

Note: We should be maintain for the core Directory structure and files on frameworks, due to feature migration and enhance the project and testing purpose.



来源:https://stackoverflow.com/questions/24347503/laravel-runtimeexception-could-not-scan-for-classes-inside-app-tests-testca

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!