diff --git a/src/TextUI/Command.php b/src/TextUI/Command.php index 64c1a664252..f6bc6d594bb 100644 --- a/src/TextUI/Command.php +++ b/src/TextUI/Command.php @@ -772,6 +772,11 @@ protected function handleSelfUpdate() ); $localFilename = realpath($_SERVER['argv'][0]); + if (!is_writable($localFilename)) { + print "No write permission to update " . $localFilename . "\n"; + exit(PHPUnit_TextUI_TestRunner::EXCEPTION_EXIT); + } + $tempFilename = basename($localFilename, '.phar') . '-temp.phar'; // Workaround for https://bugs.php.net/bug.php?id=65538