Change order of MP API subscribe/unsubscribe calls checks to be backward compatible
In the previous version we checked the lists parameter before the subscriber. [MAILPOET-4291]
This commit is contained in:
committed by
Veljko V
parent
877fd9d7da
commit
5d3c851d02
@ -374,6 +374,24 @@ class SubscribersTest extends \MailPoetTest {
|
||||
expect($result['subscriptions'][0]['status'])->equals(SubscriberEntity::STATUS_UNSUBSCRIBED);
|
||||
}
|
||||
|
||||
public function testItChecksEmptyParamsInCorrectOrder() {
|
||||
// test if segments are specified
|
||||
try {
|
||||
$this->getApi()->unsubscribeFromLists(null, []);
|
||||
$this->fail('Segments are required exception should have been thrown.');
|
||||
} catch (\Exception $e) {
|
||||
expect($e->getMessage())->equals('At least one segment ID is required.');
|
||||
}
|
||||
|
||||
// test if segments are specified
|
||||
try {
|
||||
$this->getApi()->unsubscribeFromLists(null, [1]);
|
||||
$this->fail('Subscriber is required exception should have been thrown.');
|
||||
} catch (\Exception $e) {
|
||||
expect($e->getMessage())->equals('A subscriber is required.');
|
||||
}
|
||||
}
|
||||
|
||||
public function _after() {
|
||||
$this->truncateEntity(SubscriberEntity::class);
|
||||
$this->truncateEntity(SegmentEntity::class);
|
||||
|
Reference in New Issue
Block a user