diff --git a/tests/phpunit/src/Commands/UpdateCommandTest.php b/tests/phpunit/src/Commands/UpdateCommandTest.php deleted file mode 100644 index 4e34f0c2b..000000000 --- a/tests/phpunit/src/Commands/UpdateCommandTest.php +++ /dev/null @@ -1,76 +0,0 @@ -injectCommand(UpdateCommand::class); - } - - public function testNonPharException(): void { - - try { - $this->executeCommand([], []); - } - catch (Exception $e) { - $this->assertStringContainsString('update only works when running the phar version of ', $e->getMessage()); - } - } - - /** - * @requires OS linux|darwin - */ - public function testDownloadUpdate(): void { - - $stub_phar = $this->fs->tempnam(sys_get_temp_dir(), 'acli_phar'); - $this->fs->chmod($stub_phar, 0751); - $original_file_perms = fileperms($stub_phar); - $this->command->setPharPath($stub_phar); - - $args = [ - '--allow-unstable' => '', - ]; - $this->executeCommand($args, []); - - $output = $this->getDisplay(); - $this->assertEquals($this->getStatusCode(), 0); - $this->assertStringContainsString('Updated from UNKNOWN to', $output); - $this->assertFileExists($stub_phar); - - // The file permissions on the new phar should be the same as on the old phar. - $this->assertEquals($original_file_perms, fileperms($stub_phar) ); - - // Execute it. - $process = new Process([$stub_phar]); - $output = $process->mustRun()->getOutput(); - $this->assertStringContainsString('Available commands:', $output); - } - - /** - * @return string - */ - protected function createPharStub(): string { - $stub_phar = $this->fs->tempnam(sys_get_temp_dir(), 'acli_phar'); - $this->fs->chmod($stub_phar, 0751); - $this->command->setPharPath($stub_phar); - return $stub_phar; - } - -}