Skip to content

Instantly share code, notes, and snippets.

@anvyst
Created October 21, 2014 13:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anvyst/fb706dc4f59848c6cb47 to your computer and use it in GitHub Desktop.
Save anvyst/fb706dc4f59848c6cb47 to your computer and use it in GitHub Desktop.
Force Phing to Fail on CakePHP tests
<target name="caketest-local" description="Run CakePHP unit tests with PHPUnit and print human readable output.">
<exec dir="${basedir}" executable="${basedir}/app/Console/cake" output="${logdir}/caketest.log" returnProperty="test_result">
<arg line="test" />
<arg line="--stderr"/>
<arg line="--configuration=${basedir}/phpunit-coverage-text.xml" />
<arg line="app" />
<arg line="AllTests" />
</exec>
<if>
<not>
<equals arg1="${test_result}" arg2="0"/>
</not>
<then>
<fail msg="Build FAILED! Check caketest.log for details"/>
</then>
</if>
</target>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment