/**
  * @expectedException \RuntimeException
  */
 public function testDeletePluginFailsIfNotInstalled()
 {
     $args = self::$deleteCommand->parseArgs(new StringArgs('My\\Plugin\\Class'));
     $this->manager->expects($this->once())->method('hasPluginClass')->with('My\\Plugin\\Class')->willReturn(false);
     $this->manager->expects($this->never())->method('removePluginClass');
     $this->handler->handleDelete($args);
 }
 public function testClearRootInstallerDescriptors()
 {
     $this->rootPackageFile->setExtraKey(AssetPlugin::INSTALLERS_KEY, (object) array('symlink' => (object) array('class' => 'SymlinkInstaller'), 'cdn' => (object) array('class' => 'CdnInstaller')));
     $this->packageFileManager->expects($this->once())->method('removeExtraKey')->with(AssetPlugin::INSTALLERS_KEY);
     $this->manager->clearRootInstallerDescriptors();
     $this->assertFalse($this->manager->hasInstallerDescriptor('symlink'));
     $this->assertFalse($this->manager->hasInstallerDescriptor('cdn'));
 }
 public function testResetKey()
 {
     $args = self::$resetCommand->parseArgs(new StringArgs('the-key'));
     $this->manager->expects($this->once())->method('removeConfigKey')->with('the-key');
     $statusCode = $this->handler->handleReset($args);
     $this->assertSame(0, $statusCode);
     $this->assertEmpty($this->io->fetchOutput());
     $this->assertEmpty($this->io->fetchErrors());
 }
 protected function populateDefaultManager()
 {
     $this->packageFileManager->expects($this->any())->method('getExtraKey')->with(PackageFileServerManager::SERVERS_KEY)->willReturn((object) array('localhost' => (object) array('installer' => 'symlink', 'document-root' => 'web', 'url-format' => '/public/%s')));
 }
 protected function populateDefaultManager()
 {
     $this->packageFileManager->expects($this->any())->method('getExtraKey')->with(AssetPlugin::INSTALL_TARGETS_KEY)->willReturn((object) array('local' => (object) array('installer' => 'symlink', 'location' => 'web', 'url-format' => '/public/%s', 'default' => true)));
 }