|
10 | 10 | use xp\lambda\{PackageLambda, Sources}; |
11 | 11 |
|
12 | 12 | class PackagingTest { |
13 | | - private $archives= [], $cleanup= []; |
| 13 | + private $cleanup= []; |
14 | 14 |
|
15 | 15 | /** Creates a new temporary folder */ |
16 | 16 | private function tempDir(): Folder { |
@@ -69,15 +69,11 @@ private function package(Sources $sources): ZipIterator { |
69 | 69 | } |
70 | 70 |
|
71 | 71 | // Remember to close the archive |
72 | | - $this->archives[]= $zip= ZipFile::open($target); |
73 | | - return $zip->iterator(); |
| 72 | + return ZipFile::open($target)->iterator(); |
74 | 73 | } |
75 | 74 |
|
76 | 75 | #[After] |
77 | 76 | private function cleanup() { |
78 | | - foreach ($this->files as $file) { |
79 | | - $file->close(); |
80 | | - } |
81 | 77 | foreach ($this->cleanup as $folder) { |
82 | 78 | $this->removeDir($folder); |
83 | 79 | } |
@@ -127,7 +123,7 @@ public function test_sources_ignored($test) { |
127 | 123 | $path= $this->create([ |
128 | 124 | 'src' => [Sources::IS_FOLDER, 0755], |
129 | 125 | $test => [Sources::IS_FOLDER, 0755], |
130 | | - $test.'/t.sh' => [Sources::IS_FILE, 'Test'], |
| 126 | + $test.'/t.sh' => [Sources::IS_FILE, '#!/bin/sh ...'], |
131 | 127 | 'src/file.txt' => [Sources::IS_FILE, 'Test'] |
132 | 128 | ]); |
133 | 129 | $zip= $this->package(new Sources($path, ['src'])); |
|
0 commit comments