1 | <?php |
---|
2 | /// FIXME: Tests not implemented. |
---|
3 | return; |
---|
4 | |
---|
5 | /** |
---|
6 | * PHPUnit test case for Upload |
---|
7 | * |
---|
8 | * The method skeletons below need to be filled in with |
---|
9 | * real data so that the tests will run correctly. Replace |
---|
10 | * all EXPECTED_VAL and PARAM strings with real data. |
---|
11 | * |
---|
12 | * Created with PHPUnit_Skeleton on 2005-08-09 |
---|
13 | */ |
---|
14 | require_once 'PHPUnit.php'; |
---|
15 | class UploadTest extends PHPUnit_TestCase { |
---|
16 | |
---|
17 | var $Upload; |
---|
18 | |
---|
19 | function UploadTest($name) |
---|
20 | { |
---|
21 | $this->PHPUnit_TestCase($name); |
---|
22 | } |
---|
23 | |
---|
24 | function setUp() |
---|
25 | { |
---|
26 | require dirname(__FILE__) . '/_config.inc.php'; |
---|
27 | require_once '../lib/Upload.inc.php'; |
---|
28 | $this->Upload =& new Upload(PARAM); |
---|
29 | } |
---|
30 | |
---|
31 | function tearDown() |
---|
32 | { |
---|
33 | unset($this->Upload); |
---|
34 | } |
---|
35 | |
---|
36 | function test_setparam() |
---|
37 | { |
---|
38 | $result = $this->Upload->setparam(PARAM); |
---|
39 | $expected = EXPECTED_VAL; |
---|
40 | $this->assertEquals($expected, $result); |
---|
41 | } |
---|
42 | |
---|
43 | function test_getparam() |
---|
44 | { |
---|
45 | $result = $this->Upload->getparam(PARAM); |
---|
46 | $expected = EXPECTED_VAL; |
---|
47 | $this->assertEquals($expected, $result); |
---|
48 | } |
---|
49 | |
---|
50 | function test_setuploadpath() |
---|
51 | { |
---|
52 | $result = $this->Upload->setuploadpath(PARAM); |
---|
53 | $expected = EXPECTED_VAL; |
---|
54 | $this->assertEquals($expected, $result); |
---|
55 | } |
---|
56 | |
---|
57 | function test_process() |
---|
58 | { |
---|
59 | $result = $this->Upload->process(PARAM); |
---|
60 | $expected = EXPECTED_VAL; |
---|
61 | $this->assertEquals($expected, $result); |
---|
62 | } |
---|
63 | |
---|
64 | function test_deletefile() |
---|
65 | { |
---|
66 | $result = $this->Upload->deletefile(PARAM); |
---|
67 | $expected = EXPECTED_VAL; |
---|
68 | $this->assertEquals($expected, $result); |
---|
69 | } |
---|
70 | |
---|
71 | function test_movefile() |
---|
72 | { |
---|
73 | $result = $this->Upload->movefile(PARAM); |
---|
74 | $expected = EXPECTED_VAL; |
---|
75 | $this->assertEquals($expected, $result); |
---|
76 | } |
---|
77 | |
---|
78 | function test_exists() |
---|
79 | { |
---|
80 | $result = $this->Upload->exists(PARAM); |
---|
81 | $expected = EXPECTED_VAL; |
---|
82 | $this->assertEquals($expected, $result); |
---|
83 | } |
---|
84 | |
---|
85 | function test_geterrors() |
---|
86 | { |
---|
87 | $result = $this->Upload->geterrors(PARAM); |
---|
88 | $expected = EXPECTED_VAL; |
---|
89 | $this->assertEquals($expected, $result); |
---|
90 | } |
---|
91 | |
---|
92 | function test_cleanfilename() |
---|
93 | { |
---|
94 | $result = $this->Upload->cleanfilename(PARAM); |
---|
95 | $expected = EXPECTED_VAL; |
---|
96 | $this->assertEquals($expected, $result); |
---|
97 | } |
---|
98 | |
---|
99 | function test_getfilenameextension() |
---|
100 | { |
---|
101 | $result = $this->Upload->getfilenameextension(PARAM); |
---|
102 | $expected = EXPECTED_VAL; |
---|
103 | $this->assertEquals($expected, $result); |
---|
104 | } |
---|
105 | |
---|
106 | } |
---|
107 | // Running the test. |
---|
108 | $suite = new PHPUnit_TestSuite('UploadTest'); |
---|
109 | $result = PHPUnit::run($suite); |
---|
110 | echo $result->toString(); |
---|
111 | ?> |
---|