How to setup xampp, phpunit, ant, zend framework
First post here, so take it easy please.
I'm working through the first chapter of Zend Framework 1.8 Web Application Development by Keith Pope in an effort to learn PHP and the MVC framework.
I thought I included all the paths correctly and installed PHPUnit 3.3 correctly as well as Zend 1.8 and 1.7.4 Xampp. with Ant version 1.8.2. However, I can't seem to get the first simplest build to build.
From looking at other q's and a's on this site I can tell some of the calls in the build.xml file for PHPunit aren't correct and I've tried to correct them, but now I'm getting the error that C:\xampp\htdocs\zendStoreFront/library/Zend does not exist and when I add the Zend directory in I get lots and lots of errors which is telling me that's probably not the right answer.
I understand there's a lot going on in the whole project and I'm willing to take the time to learn, but one question- On the line that says " --log-xml ${basedir}/build/logs/phpunit.xml ", is this file expected to be in this directory already, or does the build process create the file? On some attempts an error that's echo'd back say that file doesn't exist and currently there is no file in that directory.
Thanks,
hestes
cmd line output
*****************
C:\xampp\htdocs\zendStoreFront\build>ant
Buildfile: C:\xampp\htdocs\zendStoreFront\build\build.xml
buildPreparation:
getProps:
[echo] ---- Build Properties ----
[echo]
[echo] OS is Windows XP
[echo] Basedir is C:\xampp\htdocs\zendStoreFront
[echo] Property file is C:\xampp\htdocs\zendStoreFront/build/ant.properties
[echo] Script-suffix is .bat
[echo]
[echo] ---- Storefront Properties ----
[echo]
[echo] Environment is development
configure:
[copy] Copying 1 file to C:\xampp\htdocs\zendStoreFront\application
test:
[exec] The filename, directory name, or volume label syntax is incorrect.
[exec] PHPUnit 3.3.10 by Sebastian Bergmann.
[exec]
[exec] C:\xampp\htdocs\zendStoreFront/library/Zend does not exist
BUILD FAILED
C:\xampp\htdocs\zendStoreFront\build\build.xml:28: exec returned: 1
Total time: 1 second
C:\xampp\htdocs\zendStoreFront\build>cd ..
C:\xampp\htdocs\zendStoreFront>ant -version
Apache Ant(TM) version 1.8.2 compiled on December 20 2010
Build.xml File
<target name="getProps">
<property file="${basedir}/build/ant.properties" />
<condition property="script-suffix" value=".bat" else="">
<os family="windows" />
</condition>
<echo message="---- Build Properties ----" />
<echo message="" />
<echo message="OS is ${os.name}" />
<echo message="Basedir is ${basedir}" />
<echo message="Property file is ${basedir}/build/ant.properties" />
<echo message="Script-suffix is ${script-suffix}" />
<echo message="" />
<echo message="---- Storefront Properties ----" />
<echo message="" />
<echo message="Environment is ${environment}" />
</target>
<target name="test" depends="getProps">
<exec dir="${basedir}/tests" executable="phpunit${script-suffix}" failonerror="true">
<arg line="--开发者_StackOverflow社区colors --coverage-html ${basedir}/build/report
--log-xml ${basedir}/build/logs/phpunit.xml
--log-pmd ${basedir}/build/logs/phpunit.pmd.xml
--log-metrics ${basedir}/build/logs/phpunit.metrics.xml
--coverage-clover ${basedir}/build/logs/phpunit.coverage.xml
AllTests.php"/>
</exec>
</target>
<target name="configure" depends="getProps">
<copy file="${basedir}/application/application.php.dist"
tofile="${basedir}/application/application.php" overwrite="true" />
<replace file="${basedir}/application/application.php" token="@ENVIRONMENT@" value="${environment}" />
</target>
<target name="buildPreparation">
<mkdir dir="${basedir}/build/logs" />
<mkdir dir="${basedir}/build/report" />
</target>
<target name="clean">
<delete dir="${basedir}/build/logs" />
<delete dir="${basedir}/build/report" />
</target>
<target name="build" depends="buildPreparation,configure,test"/>
精彩评论