Added post content existence validation
This commit is contained in:
parent
561ebd5508
commit
dcd2c8aa06
2 changed files with 4 additions and 0 deletions
|
@ -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');
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue