public function testOnPostPackageUninstallCanRemovePackageArraysFromConfiguration() { $this->createApplicationConfig('<' . "?php\nreturn [\n 'modules' => [\n 'Some\\Component',\n 'Other\\Component',\n ]\n];"); $package = $this->prophesize(PackageInterface::class); $package->getName()->willReturn('some/component'); $package->getExtra()->willReturn(['zf' => ['component' => ['Some\\Component', 'Other\\Component']]]); $package->getAutoload()->willReturn([]); $operation = $this->prophesize(InstallOperation::class); $operation->getPackage()->willReturn($package->reveal()); $event = $this->prophesize(PackageEvent::class); $event->isDevMode()->willReturn(true); $event->getOperation()->willReturn($operation->reveal()); $this->io->write('<info>Removing Some\\Component from package some/component</info>')->shouldBeCalled(); $this->io->write('<info>Removing Other\\Component from package some/component</info>')->shouldBeCalled(); $this->io->write(Argument::that(function ($argument) { return (bool) preg_match('#Removed package from .*?config/application.config.php#', $argument); }))->shouldBeCalled(); $this->assertNull($this->installer->onPostPackageUninstall($event->reveal())); $config = file_get_contents(vfsStream::url('project/config/application.config.php')); $this->assertNotContains('Some\\Component', $config); $this->assertNotContains('Other\\Component', $config); }