/**
  * @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 testRemoveIgnoreDirectoriesSuccessfullyRemovesEntries()
 {
     $gitIgnore = new GitIgnore($this->gitIgnoreFile, array('line1', 'line2'));
     $this->assertEquals(array('line1', 'line2'), $gitIgnore->getEntries());
     $gitIgnore->removeIgnoreDirectories();
     $this->assertEquals(array(), $gitIgnore->getEntries());
 }