File: ReplaceRegexpTaskTest.xml

package info (click to toggle)
phing 3.0.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 9,868 kB
  • sloc: php: 59,850; xml: 9,713; sql: 78; makefile: 39; sh: 14
file content (26 lines) | stat: -rw-r--r-- 864 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?xml version="1.0" encoding="UTF-8"?>
<project name="ReplaceRegexpTaskTest" default="testReplaceRegexp">
    <target name="setup">
        <echo file="test.properties">OldProperty=12345</echo>
    </target>
    <target name="clean">
        <delete file="test.properties"/>
    </target>
    <target name="testReplaceRegexp">
        <replaceregexp file="test.properties"
             match="OldProperty=(.*)"
             replace="NewProperty=\1"/>
    </target>
    <target name="testFailOnError">
        <replaceregexp file="nofile"
             match="OldProperty=(.*)"
             replace="NewProperty=\1"
             failonerror="true"/>
    </target>
    <target name="testFlags">
        <replaceregexp file="test.properties"
             match="oLDpROPERTY=(.*)"
             replace="NewProperty=\1"
             flags="i"/>
    </target>
</project>