/**
  * @param string $source
  * @param string $destination
  */
 public function unInstall($source, $destination)
 {
     $iterator = $this->getIterator($source, RecursiveIteratorIterator::CHILD_FIRST);
     foreach ($iterator as $item) {
         $destinationFile = sprintf("%s/%s", $destination, $iterator->getSubPathName());
         if ($this->exclude->exclude($iterator->getSubPathName())) {
             continue;
         }
         if (!file_exists($destinationFile)) {
             $this->gitIgnore->removeEntry($iterator->getSubPathName());
             continue;
         }
         if ($item->isDir()) {
             //check if there are not other files in this dir
             if ($this->fileSystem->isDirEmpty($destinationFile)) {
                 $this->fileSystem->removeDirectory($destinationFile);
             }
             continue;
         }
         $this->fileSystem->unlink($destinationFile);
         $this->gitIgnore->removeEntry('/' . $iterator->getSubPathName());
     }
     $this->gitIgnore->removeIgnoreDirectories();
 }
 public function testCanRemoveEntry()
 {
     $lines = array('line1', 'line2');
     file_put_contents($this->gitIgnoreFile, implode("\n", $lines));
     $gitIgnore = new GitIgnore($this->gitIgnoreFile, array(), true);
     $gitIgnore->removeEntry('line1');
     $this->assertEquals(array('line2'), $gitIgnore->getEntries());
 }