tmpDir().'/composer.lock'); $this->deleteDummyExtensions(); $composerSetup->run(); $this->composer('install'); parent::tearDown(); } private function deleteDummyExtensions(): void { $dir = $this->tmpDir().'/packages'; $it = new RecursiveDirectoryIterator($dir, FilesystemIterator::SKIP_DOTS); $files = new RecursiveIteratorIterator($it, RecursiveIteratorIterator::CHILD_FIRST); foreach ($files as $file) { if ($file->isDir()) { rmdir($file->getRealPath()); } else { unlink($file->getRealPath()); } } rmdir($dir); } protected function forgetComposerApp(): void { $this->app()->getContainer()->instance(ComposerAdapter::class, null); } }