diff --git a/src/Models/Entities/PostEntity.php b/src/Models/Entities/PostEntity.php index 5ba5b820..20fb4b99 100644 --- a/src/Models/Entities/PostEntity.php +++ b/src/Models/Entities/PostEntity.php @@ -56,6 +56,9 @@ final class PostEntity extends AbstractEntity implements IValidatable if (empty($this->getType())) throw new SimpleException('No post type detected'); + if (empty($this->tryGetWorkingFullPath())) + throw new SimpleException('No post content'); + if (empty($this->getTags())) throw new SimpleException('No tags set'); diff --git a/tests/AbstractTest.php b/tests/AbstractTest.php index b92d25c0..5558c5c0 100644 --- a/tests/AbstractTest.php +++ b/tests/AbstractTest.php @@ -38,6 +38,7 @@ class AbstractTest $post->setUploader($owner); $post->setType(new PostType(PostType::Image)); $post->setTags([$this->mockTag(), $this->mockTag()]); + copy($this->getPath('image.jpg'), $post->getFullPath()); return PostModel::save($post); }