Add check on list type
[MAILPOET-4752]
This commit is contained in:
@@ -168,6 +168,18 @@ class SegmentsTest extends \MailPoetTest {
|
||||
expect($result['description'])->equals($data['description']);
|
||||
}
|
||||
|
||||
public function testItDoesNotAllowUpdateWPSegment(): void {
|
||||
$wpSegment = $this->segmentsRepository->getWPUsersSegment();
|
||||
$this->assertInstanceOf(SegmentEntity::class, $wpSegment);
|
||||
try {
|
||||
$this->getApi()->updateList(['id' => $wpSegment->getId(), 'name' => 'Test']);
|
||||
$this->fail('WP list cannot be updated.');
|
||||
} catch (\Exception $e) {
|
||||
expect($e->getMessage())->equals('List of the type \'' . $wpSegment->getType() . '\' is not supported for this action.');
|
||||
expect($e->getCode())->equals(APIException::LIST_TYPE_IS_NOT_SUPPORTED);
|
||||
}
|
||||
}
|
||||
|
||||
public function testItRequiresIdToDeleteList(): void {
|
||||
try {
|
||||
$this->getApi()->deleteList('');
|
||||
|
Reference in New Issue
Block a user