File: ZipUnzipTaskTest.xml

package info (click to toggle)
phing 3.1.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 9,368 kB
  • sloc: php: 59,821; xml: 9,767; sql: 78; makefile: 39; sh: 14
file content (49 lines) | stat: -rw-r--r-- 1,539 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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?xml version="1.0" encoding="UTF-8"?>
<project name="ZipUnzipTaskTest" default="main">
    <property name="tmp.dir" value="tmp"/>

    <target name="setup">
    	<mkdir dir="${tmp.dir}"/>
    </target>

    <target name="clean">
        <delete dir="${tmp.dir}"/>
    </target>

    <target name="testSimpleZipContainsOneFile">
    	<echo file="${tmp.dir}/test.txt" message="TEST"/>
    	<zip destfile="${tmp.dir}/simple-test.zip">
    	    <fileset dir="${tmp.dir}">
    	        <include name="test.txt"/>
    	    </fileset>
    	</zip>
    </target>

    <target name="testZipFileSet">
        <echo file="${tmp.dir}/test.txt" message="TEST"/>
        <zip destfile="${tmp.dir}/simple-test.zip">
            <zipfileset dir="${tmp.dir}">
                <include name="test.txt"/>
            </zipfileset>
        </zip>
    </target>

    <target name="testZipBaseDir">
        <echo file="${tmp.dir}/test.txt" message="TEST"/>
        <zip destfile="${tmp.dir}/simple-test.zip" basedir="${tmp.dir}"/>
    </target>

    <target name="testUnzipSimpleZip" depends="testSimpleZipContainsOneFile">
    	<delete file="${tmp.dir}/test.txt"/>
    	<unzip file="${tmp.dir}/simple-test.zip" todir="${tmp.dir}"/>
    </target>

    <target name="testRetainOriginalPremissionsOfDirectory">
    	<delete dir="${tmp.dir}/foo"/>
        <mkdir dir="${tmp.dir}/foo/bar/"/>
        <touch file="${tmp.dir}/foo/bar/baz"/>
        <zip destfile="${tmp.dir}/simple-test.zip" basedir="${tmp.dir}"/>
    </target>

    <target name="main"/>
</project>