mrlong
mrlong

Reputation: 21

How to use phpunit in phing?

According to How to use existing phpunit.xml in phing build.xml? It should be work to use phpunit.xml in phing like this

 <phpunit configuration="./phpunit.xml">

but it's mouse, don't know why?

xml like this

<target name="test" description="Run PHPUnit tests" depends="prepare">
            <phpunit printsummary="true" configuration="./phpunit.xml" pharlocation="${pharlocation.dir}" ><!--configuration="./phpunit.xml"-->
                <formatter type="xml" todir="${xmlreport.dir}" outfile="${reportxml.dir}"/>
            </phpunit>
            <phpunitreport infile="${xmlreport.dir}/${reportxml.dir}" format="noframes" todir="${htmlreport.dir}" styledir="${xsl.dir}" />
</target>

run result like this,the phpunit donot run.I confirm the phing has find the phpuntil.xml ,when I change the name to a wrong name,the phing will prompt file donot exist.

autotest > prepare:

autotest > test:

[phpunit] Total tests run: 0, Failures: 0, Errors: 0, Incomplete: 0, Skipped: 0, Time elapsed: 0.00033 s

BUILD FINISHED

Total time: 0.5406 seconds

Upvotes: 1

Views: 937

Answers (1)

jawira
jawira

Reputation: 4598

Your Phing version is not compatible with newest PHPUnit namespaces, update Phing to v3.

Source:

Upvotes: 0

Related Questions