van
van

Reputation: 9449

Phing PHPUnit run all php files

I'm using Phing to run phpunit on a folder called runtest which contains all my phpunit tests.

My build.xml is below:

<project name="TiVO" default="build">
 <target name="clean">
  <delete dir="build"/>
 </target>

 <target name="prepare">
  <mkdir dir="build/logs"/>
 </target>

 <target name="phpunit">
  <phpunit bootstrap="runtest/initalize.php" printsummary="true" haltonfailure="true">
    <formatter todir="build/logs" type="xml"/>
    <batchtest>
      <fileset dir="runtest">
        <include name="*.php"/>
      </fileset>
    </batchtest>
  </phpunit>
 </target>

 <target name="build" depends="clean,prepare,phpunit"/>
</project>

The problem is it does not run any php files (e.g. Channel.php, Video.php) which all end in .php and only works if I change the include name to:

 <include name="*Test.php"/>

Then it runs the one file MyChannelTest.php which matches the pattern *Test.php which is fair enough.

How do i change my build.xml to run any file which ends in .php in the runtest directory? Thanks

Upvotes: 0

Views: 324

Answers (1)

van
van

Reputation: 9449

Apologies the include name filter was working there was a problem with the first phpunit file when it was executing it caused the build to fail and no tests to execute after it there was no error reported by php unit making it look like it hadn't executed any files.

Upvotes: 1

Related Questions