我正在尝试用phing执行PHPUnit,但是我发现了一些错误。
我的目标是:
<target name="tests">
<phpunit pharlocation="C:/xampp/php/phpunit.phar" printsummary="true" haltonfailure="true" haltonerror="true">
<formatter type="xml" usefile="false"/>
<batchtest>
<fileset dir=".">
<include name="tests/*Test*.php"/>
</fileset>
</batchtest>
</phpunit>
</target>但当我执行死刑时:
[phpunit] <?xml version="1.0" encoding="UTF-8"?>
[phpunit] <testsuites>
[phpunit] <testsuite name="AllTests" tests="0" assertions="0" failures="0" errors="0" time="0.000000"/>
[phpunit] </testsuites>
[phpunit] Total tests run: 0, Failures: 0, Errors: 0, Incomplete: 0, Skipped: 0, Time elapsed: 0.00496 s我不知道为什么要执行0次测试。如果我删除了testX上的错误,
致命错误:找不到类'PHPUnit\Framework\TestCase‘。
所以,当我不放药物的时候,它会发现检测结果,但是如果我把药物定位的话就不起作用了。
错误在哪里?
发布于 2018-06-21 21:12:17
这是因为Phing2.*与新PHPUnit的命名空间不兼容。
PHPUnit_Framework_TestCasePHPUnit\Framework\TestCase尝试使用Phing 3:https://www.phing.info/get/phing-3.0.0-alpha1.phar
https://stackoverflow.com/questions/50833168
复制相似问题