我有以下Phing配置文件:
<?xml version="1.0" encoding="UTF-8"?>
<project name="ru.fractalizer.phpsweetpdo" default="make-phar-packages" basedir="..">
<target name="run-tests-library" description="Running all the tests">
<phpunit>
<formatter type="plain" usefile="false"/>
<batchtest>
<classpath>.</classpath>
<fileset dir="tests/Library">
<include name="**/*Test*.php"/>
</fileset>
</batchtest>
</phpunit>
</target>
但是在这个目标上执行Phing build会给我错误:
执行目标"run-tests-library"失败,原因如下原因:Z:'Work'PHP'phpSweetPDO'phing'build.xml:5:17: phing.types. path不支持嵌套文本数据
BUILD FAILED Z:'Work'PHP'phpSweetPDO'phing' BUILD .xml:5:17:path不支持嵌套文本数据。总时间:9.0173秒
我不明白这个信息。到底什么是不支持的?
5:17为"<phpunit>"
标记所在行
问题是你的类路径定义:
<classpath>.</classpath>
嵌套文本是单个.
。你可以用不同的方式定义路径:
- 嵌套
pathelement
元素 - 嵌套
fileset
、dirset
等资源收集元素 - 内联使用
path
属性
对于您的简单情况,也许
<classpath path="." />
是正确的选择。
请参阅Ant文档中的类路径结构一节。