Why is my unit test failing via Hudson/Phing, but succeeding via Phing on the command line?
General Info:
PHP 5.3.3
PHPUnit 3.4 Zend Framework 1.10.8 开发者_JAVA百科Phing build target
<target name="test">
<echo msg="PHPUnit..." />
<phpunit codecoverage="false" haltonfailure="true" haltonerror="true" printsummary="true" bootstrap="${testdir}/application/bootstrap.php">
<batchtest>
<fileset dir="${testdir}">
<include name="**/*Test.php" />
<exclude name="./application/ControllerTestCase.php" />
<exclude name="./application/bootstrap.php" />
</fileset>
</batchtest>
<formatter type="xml" todir="${builddir}" outfile="phpunit-results.xml" />
</phpunit>
<phpunitreport infile="${builddir}/phpunit-results.xml"
styledir="${phpunit.styles.dir}"
format="frames"
todir="${builddir}" />
</target>
This works...
phing -f build.xml test
Hudson/Phing
My Phing target listed in Hudson, which uses the same build.xml file, does not work. I get the same type of error (strpos(): Empty delimiter) for every unit test, which occurs whenever $this->dispatch(..url..) is executed.
Occurs within the console output upon execution of the unit test target in Hudson
'strpos(): Empty delimiter' in /opt/phing/classes/phing/tasks/ext/phpunit/PHPUnitTask.php:279
Within the PHPUnit results XML file
strpos(): Empty delimiter
/opt/zend/library/Zend/Controller/Request/Http.php:504
/opt/zend/library/Zend/Controller/Request/Http.php:551
/opt/zend/library/Zend/Controller/Request/Http.php:615
/opt/zend/library/Zend/Test/PHPUnit/ControllerTestCase.php:187
/var/lib/hudson/.hudson/jobs/IPS/workspace/trunk/tests/application/IndexControllerTest.php:6
/opt/phing/bin/phing.php:37
Can anyone shed some light on this?
Technically speaking, I solved this problem, but by deciding not to run PHPUnit via a Hudson Phing target. Instead, I decided to run a shell command in Hudson, which at the moment works fine for our needs. If anyone has any other ideas, I'm all ears. Thanks!
精彩评论