【发布时间】:2013-01-11 02:09:33
【问题描述】:
我有一个 zend 框架 2 项目,我正在尝试设置我的 jenkins,以便可以执行单元测试。 Jenkins 在 ubuntu 上运行,我正在使用 PHPStorm 在 Windows 7 下开发。
构建.xml
<target name="phpunit" description="Run unit tests with PHPUnit">
<exec executable="phpunit" failonerror="true">
<arg value="${basedir}/module/Addressbook/test"/>
</exec>
</target>
文件夹结构:
- 项目
- 模块
- 通讯录
- 测试
- 通讯录测试
- 控制器
- AddressbookControllerTest.php
- Boostrap.php
- phpunit.xml.dist
- TestConfig.php
- 控制器
- 通讯录测试
- build.xml
- 模块
Jenkins 输出:
php单元: [执行] Sebastian Bergmann 的 PHPUnit 3.7.13。 [执行] [exec] PHP 致命错误:在第 28 行的 /var/lib/jenkins/workspace/Test/src/module/Addressbook/test/AddressbookTest/Controller/AddressbookControllerTest.php 中找不到类 'AddressbookTest\Bootstrap'我本地机器上的 PHPStorm 在运行 phpunit.xml.dist 时会这样做
D:\Zend\ZendServer\bin\php.exe -d auto_prepend_file=D:/Zend/Apache2/htdocs/demoshop/vendor/autoload.php C:\Users\ChristianB\AppData\Local\Temp\ide-phpunit.php --configuration D:/Zend/Apache2/htdocs/demoshop/module/Addressbook/test/phpunit.xml.dist我如何将它用于詹金斯?
【问题讨论】:
-
我帮不上忙。但是要从其他人那里获得帮助,他们肯定需要您的引导代码。错误很明显,找不到类。这表明您的引导失败/错误。
标签: jenkins phpunit zend-framework2