Make segment description mandatory

[MAILPOET-3077]
This commit is contained in:
Rostislav Wolny
2020-09-24 14:41:55 +02:00
committed by Veljko V
parent c78922c12e
commit 2f270575f3
4 changed files with 4 additions and 4 deletions

View File

@ -50,7 +50,7 @@ class SegmentEntity {
*/
private $dynamicFilters;
public function __construct(string $name, string $type, string $description = '') {
public function __construct(string $name, string $type, string $description) {
$this->name = $name;
$this->type = $type;
$this->description = $description;

View File

@ -259,7 +259,7 @@ class NewsletterRepositoryTest extends \MailPoetTest {
$this->entityManager->persist($queue);
$newsletter->getQueues()->add($queue);
$segment = new SegmentEntity("List for newsletter id {$newsletter->getId()}", SegmentEntity::TYPE_DEFAULT);
$segment = new SegmentEntity("List for newsletter id {$newsletter->getId()}", SegmentEntity::TYPE_DEFAULT, 'Description');
$this->entityManager->persist($segment);
$subscriber = new SubscriberEntity();

View File

@ -180,7 +180,7 @@ class EmailActionTest extends \MailPoetTest {
private function getSegmentFilter(string $action, int $newsletterId, int $linkId = null): DynamicSegmentFilterEntity {
return new DynamicSegmentFilterEntity(
new SegmentEntity('segment', SegmentEntity::TYPE_DYNAMIC),
new SegmentEntity('segment', SegmentEntity::TYPE_DYNAMIC, 'Description'),
[
'segmentType' => DynamicSegmentFilterEntity::TYPE_EMAIL,
'action' => $action,

View File

@ -67,7 +67,7 @@ class UserRoleTest extends \MailPoetTest {
private function getSegmentFilter(string $role): DynamicSegmentFilterEntity {
return new DynamicSegmentFilterEntity(
new SegmentEntity('segment', SegmentEntity::TYPE_DYNAMIC),
new SegmentEntity('segment', SegmentEntity::TYPE_DYNAMIC, 'Description'),
[
'segmentType' => DynamicSegmentFilterEntity::TYPE_USER_ROLE,
'wordpressRole' => $role,