Skip to content

Commit 5a26568

Browse files
committed
Fix test
1 parent bddf389 commit 5a26568

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

tests/pest/Interface/WebhookTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@
114114

115115
test('A Postmark bounce request with an allowed IP address marks the contact as bounced and returns a success', function() {
116116
$contact = createContact();
117-
$_SERVER['REMOTE_ADDR'] = '1.2.3.4';
118-
Campaign::$plugin->settings->postmarkAllowedIpAddresses = [$_SERVER['REMOTE_ADDR']];
117+
$userIp = Craft::$app->getRequest()->getUserIP();
118+
Campaign::$plugin->settings->postmarkAllowedIpAddresses = [$userIp];
119119

120120
$response = runActionWithParams('webhook/postmark',
121121
getPostmarkRequestParams($contact->email),
@@ -131,7 +131,7 @@
131131

132132
test('A Postmark bounce request with a disallowed IP address returns an error', function() {
133133
$contact = createContact();
134-
$_SERVER['REMOTE_ADDR'] = '4.3.2.1';
134+
Campaign::$plugin->settings->postmarkAllowedIpAddresses = ['4.3.2.1'];
135135

136136
$response = runActionWithParams('webhook/postmark',
137137
getPostmarkRequestParams($contact->email),
File renamed without changes.

0 commit comments

Comments
 (0)