gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-02 08:35:34 25 4
gpt4 key购买 nike

我知道,这不是说 Composer 或 Travis 不能工作,我不能很好地完成这项工作,我不明白自动加载如何在本地运行而不是在 Travis 构建中运行。如果有人能阐明我遇到的这个问题,我将不胜感激。

具体是找不到接口(interface)时出现的问题...当您没有看到“命名空间\命名空间\接口(interface)”时会弹出错误,我认为这应该是自动加载,对于 Travis 中的测试应该加载得不是很好。

这里是:

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

坦率地说,我认为现在还不能。我将我的代码和失败的构建留在了 github 上(直到那时,我完全失败了,但留下最后一个构建以供查看)。

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

Travis CI 构建:https://travis-ci.org/estebanmatias92/RestGalleries/jobs/19337261

最佳答案

您正在使用默认情况下不区分大小写的文件系统的 OSX 吗?尝试将文件夹 interfaces 重命名为 Interfaces

关于php - Composer 自动加载不适用于 Travis CI 中的测试,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21939277/

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