Index: trunk/phase3/tests/phpunit/includes/api/ApiTestCaseUpload.php |
— | — | @@ -19,6 +19,10 @@ |
20 | 20 | $this->clearFakeUploads(); |
21 | 21 | } |
22 | 22 | |
| 23 | + public function tearDown() { |
| 24 | + $this->clearTempUpload(); |
| 25 | + } |
| 26 | + |
23 | 27 | /** |
24 | 28 | * Helper function -- remove files and associated articles by Title |
25 | 29 | * @param $title Title: title to be removed |
— | — | @@ -101,6 +105,15 @@ |
102 | 106 | |
103 | 107 | } |
104 | 108 | |
| 109 | + function clearTempUpload() { |
| 110 | + if( isset( $_FILES['file']['tmp_name'] ) ) { |
| 111 | + $tmp = $_FILES['file']['tmp_name']; |
| 112 | + if( file_exists( $tmp ) ) { |
| 113 | + unlink( $tmp ); |
| 114 | + } |
| 115 | + } |
| 116 | + } |
| 117 | + |
105 | 118 | /** |
106 | 119 | * Remove traces of previous fake uploads |
107 | 120 | */ |