Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9136129
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T08:54:46+00:00 2026-06-17T08:54:46+00:00

I am using phing to build my CakePHP web application. I want to have

  • 0

I am using phing to build my CakePHP web application.

I want to have a phing target that goes along these lines:

  1. Run the test suite
  2. if there is even 1 failure, end the phing target
  3. if all okay, run the command “git commit -a”

For my test suite, I follow the CakePHP convention which uses PHPUnit

${cake} testsuite ${runinworkspaceapp} app AllTests --log-junit ${builddir}/logs/junit.xml

where

  • ${cake} simply means ${appdir}/Console/cake
  • ${runinworkspaceapp} means -app ${appdir}

I will generate a junit.xml file. Below is a snippet of the junit.xml

<testsuites>
  <testsuite name="All Tests" tests="44" assertions="373" failures="0" errors="0" time="4.634020">
    <testsuite name="All Model related class tests" tests="42" assertions="370" failures="0" errors="0" time="4.478717">

I suspect that I need to evaluate the junit.xml file in order to tell whether there is any error. I could be wrong and there is a better way.

How do I write the phing target?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T08:54:46+00:00Added an answer on June 17, 2026 at 8:54 am

    Cake should exit with an exit code != 0 when at least one test failed, so using <exec> with checkreturn="true" should suffice.


    junit.xml can be converted to HTML with a phing task (also see http://cweiske.de/tagebuch/visualizing-phpunit-runs.htm):

    <?xml version="1.0" encoding="utf-8"?>
    <project name="testreport" default="gen-report" basedir=".">
     <target name="gen-report">
      <phpunitreport infile="log.junit.xml"
                     format="frames"
                     todir="html"
                     styledir="/usr/share/php/data/phing/etc/"
                     />
     </target>
    </project>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using Phing to create build files, but I've noticed that it does not
I'm using Phing as my build tool for a website i'm developing. I have
I'm using Phing to do post build tasks in Hudson. I want to generate
I have a huge Ping list and want to clean it. Using PHP I
I'm using Phing to set up a build process for a large PHP project.
I'm currently working on a build system in Phing that takes a Zend Framework
I am installing phing using instructions here I get the following error. I have
We're building a touch screen kiosk application that will run on Windows POS Ready
I am writing PHP directly inside a Phing build.xml file using adhoc-task . The
We're using phing to deploy our php application and we got into a little

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.