简体   繁体   English

Composer自动加载不适用于Travis CI中的测试

[英]Composer autoload doesn't work for tests in Travis CI

I know, isnt as if Composer or Travis not work, I do not get to do that work fine, I do not understand how autoload runs locally but not in Travis build. 我知道,不是好像Composer或Travis不能正常工作,我不能很好地完成工作,我不了解自动加载如何在本地运行,但不能在Travis构建中运行。 If someone could shed light on this problem that I have, I would be very grateful. 如果有人能阐明我遇到的这个问题,我将非常感激。

The problem specifically is displayed when you can not find an interface ... as the error pops up when you do not see the "namespace\\namespace\\interface", I think that should be the autoload, should not be loading very well for the test in Travis. 当您找不到接口时会特别显示该问题...当您看不到“名称空间\\名称空间\\接口”时会弹出错误,我认为应该是自动加载,对于该加载不应该很好在特拉维斯测试。

Here is: 这是:

PHP Fatal error:  Interface 'RestGalleries\Interfaces\User' not found in /home/travis/build/estebanmatias92/RestGalleries/src/RestGalleries/APIs/Flickr/FlickrUser.php on line 15
PHP Stack trace:
PHP   1. {main}() /home/travis/.phpenv/versions/5.4.25/bin/phpunit:0
PHP   2. PHPUnit_TextUI_Command::main() /home/travis/.phpenv/versions/5.4.25/bin/phpunit:46
PHP   3. PHPUnit_TextUI_Command->run() /home/travis/.phpenv/versions/5.4.25/share/pyrus/.pear/php/PHPUnit/TextUI/Command.php:129
PHP   4. PHPUnit_TextUI_TestRunner->doRun() /home/travis/.phpenv/versions/5.4.25/share/pyrus/.pear/php/PHPUnit/TextUI/Command.php:176
PHP   5. PHPUnit_Framework_TestSuite->run() /home/travis/build/estebanmatias92/RestGalleries/vendor/phpunit/phpunit/PHPUnit/TextUI/TestRunner.php:349
PHP   6. PHPUnit_Framework_TestSuite->run() /home/travis/build/estebanmatias92/RestGalleries/vendor/phpunit/phpunit/PHPUnit/Framework/TestSuite.php:705
PHP   7. PHPUnit_Framework_TestSuite->run() /home/travis/build/estebanmatias92/RestGalleries/vendor/phpunit/phpunit/PHPUnit/Framework/TestSuite.php:705
PHP   8. PHPUnit_Framework_TestSuite->runTest() /home/travis/build/estebanmatias92/RestGalleries/vendor/phpunit/phpunit/PHPUnit/Framework/TestSuite.php:745
PHP   9. PHPUnit_Framework_TestCase->run() /home/travis/build/estebanmatias92/RestGalleries/vendor/phpunit/phpunit/PHPUnit/Framework/TestSuite.php:775
PHP  10. PHPUnit_Framework_TestResult->run() /home/travis/build/estebanmatias92/RestGalleries/vendor/phpunit/phpunit/PHPUnit/Framework/TestCase.php:783
PHP  11. PHPUnit_Framework_TestCase->runBare() /home/travis/build/estebanmatias92/RestGalleries/vendor/phpunit/phpunit/PHPUnit/Framework/TestResult.php:648
PHP  12. PHPUnit_Framework_TestCase->runTest() /home/travis/build/estebanmatias92/RestGalleries/vendor/phpunit/phpunit/PHPUnit/Framework/TestCase.php:838
PHP  13. ReflectionMethod->invokeArgs() /home/travis/build/estebanmatias92/RestGalleries/vendor/phpunit/phpunit/PHPUnit/Framework/TestCase.php:983
PHP  14. RestGalleriesTest->testFindUserReturnApiUserObject() /home/travis/build/estebanmatias92/RestGalleries/vendor/phpunit/phpunit/PHPUnit/Framework/TestCase.php:983
PHP  15. Composer\Autoload\ClassLoader->loadClass() /home/travis/build/estebanmatias92/RestGalleries/vendor/phpunit/phpunit/PHPUnit/Framework/TestCase.php:0
PHP  16. Composer\Autoload\includeFile() /home/travis/build/estebanmatias92/RestGalleries/vendor/composer/ClassLoader.php:269
PHP  17. include() /home/travis/build/estebanmatias92/RestGalleries/vendor/composer/ClassLoader.php:363

Frankly I can not think it can be right now. 坦白说,我认为现在不可能。 I leave my code on github and the failing build (Until the time, i have failed at all with this, but leave the last build to see). 我将代码留在github和失败的构建上(直到现在,我在此方面都失败了,但最后一个构建可以看看)。

Github: https://github.com/estebanmatias92/RestGalleries GitHub: https : //github.com/estebanmatias92/RestGalleries

Travis CI build: https://travis-ci.org/estebanmatias92/RestGalleries/jobs/19337261 Travis CI版本: https//travis-ci.org/estebanmatias92/RestGalleries/jobs/19337261

Are you are working on OSX which has case-insensitive filesystem by default? 您是否正在使用默认情况下不区分大小写的文件系统的OSX? Try renaming the folder interfaces to Interfaces . 尝试将文件夹interfaces重命名为Interfaces

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM