/**
  * @param Folder $folder
  */
 private function deleteMedia(Folder $folder)
 {
     $em = $this->getEntityManager();
     /** @var Media $media */
     foreach ($folder->getMedia() as $media) {
         $media->setDeleted(true);
         $em->persist($media);
     }
 }
 /**
  * @covers Kunstmaan\MediaBundle\Entity\Folder::getMedia
  */
 public function testGetMedia()
 {
     $media = new Media();
     $this->object->addMedia($media);
     $deletedMedia = new Media();
     $deletedMedia->setDeleted(true);
     $this->object->addMedia($deletedMedia);
     $this->assertCount(1, $this->object->getMedia());
     $this->assertCount(1, $this->object->getMedia(false));
     $this->assertCount(2, $this->object->getMedia(true));
     $folderMedia = $this->object->getMedia(false);
     $this->assertContains($media, $folderMedia);
     $this->assertNotContains($deletedMedia, $folderMedia);
     $folderMedia = $this->object->getMedia(true);
     $this->assertContains($media, $folderMedia);
     $this->assertContains($deletedMedia, $folderMedia);
 }