/**
  * @param object $entity
  *
  * @return bool
  */
 private function prepareMedia($entity)
 {
     if (!$entity instanceof Media) {
         return false;
     }
     $this->mediaManager->prepareMedia($entity);
     return true;
 }
 /**
  * @covers Kunstmaan\MediaBundle\Helper\MediaManager::prepareMedia
  */
 public function testPrepareMediaWithCustomHandler()
 {
     $media = new Media();
     $handler = $this->getCustomHandler($media);
     $handler->expects($this->once())->method('prepareMedia')->with($this->equalTo($media));
     $this->object->addHandler($handler);
     $this->object->prepareMedia($media);
 }