public function testPostCreation()
 {
     $this->assertInstanceOf('App\\Domain\\Post\\Post', $this->post);
     $this->assertInstanceOf('App\\Domain\\Identity\\Uuid', $this->post->getId());
     $this->assertInternalType('string', $this->post->getTitle());
     $this->assertInternalType('string', $this->post->getContent());
     $this->assertInternalType('string', $this->post->getDescription());
     $this->assertInstanceOf('App\\Domain\\Post\\PublishStatus', $this->post->getStatus());
     $this->assertTrue(PublishStatus::draft()->equals($this->post->getStatus()));
     $this->assertInstanceOf('DateTime', $this->post->getCreated());
     $this->assertNull($this->post->getPublished());
     $this->assertNull($this->post->getModified());
     $this->assertNull($this->post->getExpires());
     $this->assertFalse($this->post->isPublished());
 }
示例#2
0
 /**
  * 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());
 }