File tree 4 files changed +34
-3
lines changed
4 files changed +34
-3
lines changed Original file line number Diff line number Diff line change @@ -157,15 +157,14 @@ before_install:
157
157
fi
158
158
if [[ $PHP = nightly ]]; then
159
159
tfold ext.memcached tpecl memcached-3.1.5 memcached.so $INI
160
- tfold ext.apcu install_apcu_dev 9c36db45100d4d27ec33072f4be90f1f5a0108b7 $INI
161
160
else
162
- tfold ext.apcu tpecl apcu-5.1.19 apcu.so $INI
163
161
tfold ext.mongodb tpecl mongodb-1.6.16 mongodb.so $INI
164
162
tfold ext.zookeeper tpecl zookeeper-0.7.2 zookeeper.so $INI
165
163
tfold ext.amqp tpecl amqp-1.10.2 amqp.so $INI
166
164
tfold ext.redis tpecl redis-5.2.2 redis.so $INI "no"
167
165
fi
168
166
167
+ tfold ext.apcu tpecl apcu-5.1.19 apcu.so $INI
169
168
tfold ext.igbinary tpecl igbinary-3.1.6 igbinary.so $INI
170
169
done
171
170
- |
Original file line number Diff line number Diff line change @@ -175,7 +175,7 @@ public function remove($files)
175
175
if (!self ::box ('rmdir ' , $ file ) && file_exists ($ file )) {
176
176
throw new IOException (sprintf ('Failed to remove directory "%s": ' , $ file ).self ::$ lastError );
177
177
}
178
- } elseif (!self ::box ('unlink ' , $ file ) && file_exists ($ file )) {
178
+ } elseif (!self ::box ('unlink ' , $ file ) && ( false !== strpos ( self :: $ lastError , ' Permission denied ' ) || file_exists ($ file) )) {
179
179
throw new IOException (sprintf ('Failed to remove file "%s": ' , $ file ).self ::$ lastError );
180
180
}
181
181
}
Original file line number Diff line number Diff line change 11
11
12
12
namespace Symfony \Component \Filesystem \Tests ;
13
13
14
+ use Symfony \Component \Filesystem \Exception \IOException ;
15
+
14
16
/**
15
17
* Test class for Filesystem.
16
18
*/
@@ -334,6 +336,28 @@ public function testRemoveIgnoresNonExistingFiles()
334
336
$ this ->assertFileDoesNotExist ($ basePath .'dir ' );
335
337
}
336
338
339
+ public function testRemoveThrowsExceptionOnPermissionDenied ()
340
+ {
341
+ $ this ->markAsSkippedIfChmodIsMissing ();
342
+
343
+ $ basePath = $ this ->workspace .\DIRECTORY_SEPARATOR .'dir_permissions ' ;
344
+ mkdir ($ basePath );
345
+ $ file = $ basePath .\DIRECTORY_SEPARATOR .'file ' ;
346
+ touch ($ file );
347
+ chmod ($ basePath , 0400 );
348
+
349
+ try {
350
+ $ this ->filesystem ->remove ($ file );
351
+ $ this ->fail ('Filesystem::remove() should throw an exception ' );
352
+ } catch (IOException $ e ) {
353
+ $ this ->assertStringContainsString ('Failed to remove file " ' .$ file .'" ' , $ e ->getMessage ());
354
+ $ this ->assertStringContainsString ('Permission denied ' , $ e ->getMessage ());
355
+ } finally {
356
+ // Make sure we can clean up this file
357
+ chmod ($ basePath , 0777 );
358
+ }
359
+ }
360
+
337
361
public function testRemoveCleansInvalidLinks ()
338
362
{
339
363
$ this ->markAsSkippedIfSymlinkIsMissing ();
Original file line number Diff line number Diff line change @@ -302,6 +302,14 @@ private static function startVulcain(HttpClientInterface $client)
302
302
sleep ('\\' === \DIRECTORY_SEPARATOR ? 10 : 1 );
303
303
304
304
if (!$ process ->isRunning ()) {
305
+ if ('\\' !== \DIRECTORY_SEPARATOR && 127 === $ process ->getExitCode ()) {
306
+ self ::markTestSkipped ('vulcain binary is missing ' );
307
+ }
308
+
309
+ if ('\\' !== \DIRECTORY_SEPARATOR && 126 === $ process ->getExitCode ()) {
310
+ self ::markTestSkipped ('vulcain binary is not executable ' );
311
+ }
312
+
305
313
self::markTestSkipped ((new ProcessFailedException ($ process ))->getMessage ());
306
314
}
307
315
You can’t perform that action at this time.
0 commit comments