PhpUndercontrol没有在我的项目中进行任何测试(在巡航控制/项目内)我有这个:
/www/tests/DomainTEst/DomainTest.php(例如我想现在只运行一次测试)
<?xml version="1.0" encoding="UTF-8"?>
<project name="myproject" default="build" basedir=".">
<target name="build" depends="checkout,php-documentor,php-codesniffer,phpmd,phpunit" />
<target name="checkout">
<exec executable="git" dir="${basedir}/source" failonerror="on">
<arg line="pull origin master"/>
</exec>
</target>
<target name="php-documentor">
<exec executable="phpdoc" dir="${basedir}/source">
<arg line="-ct type -ue on -t ${basedir}/build/api -tb /usr/share/php/data/phpUnderControl/data/phpdoc -o HTML:Phpuc:phpuc -d src/"/>
</exec>
</target>
<target name="php-codesniffer">
<exec executable="phpcs" dir="${basedir}/source" output="${basedir}/build/logs/checkstyle.xml">
<arg line="--report=checkstyle --standard=PEAR --ignore=src/autoload src/"/>
</exec>
</target>
<target name="phpmd">
<exec executable="phpmd" dir="${basedir}/source">
<arg line="./src xml codesize,unusedcode,naming"/>
</exec>
</target>
//here is the problem I suppose!!!!!!!!!!!!!
<target name="phpunit">
<exec executable="phpunit" dir="${basedir}/source" failonerror="on">
<arg line="--log-junit ${basedir}/build/logs/phpunit.xml --coverage-xml ${basedir}/build/logs/phpunit.coverage.xml --coverage-html ${basedir}/build/coverage DomainTest www/tests/DomainTest/DomainTest.php" />
</exec>
</target>
</project>
答案 0 :(得分:0)
你回来的错误是什么?
我认为你需要一个领先的斜杠
www/tests/DomainTest/DomainTest.php
但是,在PhpUnderControl中,你的单元测试应该测试PhpUnderControl目录中实际存在的代码,我相信它应该是这样的:
/opt/cruisecontrol/projects/your project name/your project tests folder
如果您的测试文件夹名为“tests”,并且您的PHPunit目标中的“dir”是“$ {basedir} / source”,则您只需要提供相对路径,即“test”。 / p>