File: FileSizeTaskTest.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,520 bytes parent folder | download | duplicates (2)
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="FileSizeTaskTest" default="clean">

    <property name="dummy.path" value="../../../tmp/dummy.txt"/>

    <target name="clean" description="Delete dummy file">
        <delete file="${dummy.path}"/>
    </target>

    <target name="testSimpleCase">
        <truncate file="${dummy.path}" length="${dummy.size}"/>
        <filesize file="${dummy.path}"/>
    </target>

    <target name="testPropertyNameAttribute">
        <truncate file="${dummy.path}" length="${dummy.size}"/>
        <filesize file="${dummy.path}" propertyname="my-filesize"/>
    </target>

    <target name="testUnitAttribute">
        <truncate file="${dummy.path}" length="${dummy.size}"/>
        <filesize file="${dummy.path}" unit="${filesize.unit}"/>
    </target>

    <target name="testExceptionFileNotSet">
        <filesize/>
    </target>

    <target name="testExceptionInvalidFile">
        <filesize file="invalid-file"/>
    </target>

    <target name="testExceptionInvalidUnit">
        <truncate file="${dummy.path}" length="${dummy.size}"/>
        <filesize file="${dummy.path}" unit="foo"/>
    </target>

    <target name="testExceptionEmptyUnit">
        <truncate file="${dummy.path}" length="${dummy.size}"/>
        <filesize file="${dummy.path}" unit=""/>
    </target>

    <target name="testExceptionEmptyProperty">
        <truncate file="${dummy.path}" length="${dummy.size}"/>
        <filesize file="${dummy.path}" propertyname=""/>
    </target>

</project>