/** * Compute data from the given post in the given post entity * * @param Post $post * @param PostEntity $entity */ public function computeTo(Post $post, PostEntity $entity) { $entity->setTitle($post->getTitle())->setAuthor($post->getAuthor())->setGfycatKey($post->getGfycatKey())->setBaseUrl($post->getBaseUrl())->setCreatedAt($post->getCreatedAt())->setWebmUrl($post->getWebmUrl())->setMp4Url($post->getMp4Url())->setWidth($post->getWidth())->setHeight($post->getHeight()); }
/** * {@inheritdoc} */ public function add(Post $post) { $entity = $this->find($post->getIdentifier()); $this->converter->computeTo($post, $entity); $this->getRepository()->save($entity); }
public function testCancelPage() { $this->post->cancel(); $this->assertTrue(PublishStatus::canceled()->equals($this->post->getStatus())); $this->assertFalse($this->post->isPublished()); }