-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from notz/fix-test-data
fix: Test data
- Loading branch information
Showing
1 changed file
with
41 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,7 +32,7 @@ public function testPostalTransportNotConfigured(): void | |
|
||
public function testPostalCallbackProcessWithMessageFailed(): void | ||
{ | ||
$parameters = $this->getFailedParameters(); | ||
$parameters = $this->getDeliveryFailedParameters(); | ||
|
||
$contact = $this->createContact('[email protected]'); | ||
$this->em->flush(); | ||
|
@@ -47,7 +47,7 @@ public function testPostalCallbackProcessWithMessageFailed(): void | |
|
||
$dnc = $contact->getDoNotContact()->current(); | ||
Assert::assertSame('email', $dnc->getChannel()); | ||
Assert::assertSame('Hard bounce', $dnc->getComments()); | ||
Assert::assertSame('Delivery failed', $dnc->getComments()); | ||
Assert::assertSame($nowFormatted, $dnc->getDateAdded()->format(DateTimeHelper::FORMAT_DB)); | ||
Assert::assertSame($contact, $dnc->getLead()); | ||
Assert::assertSame(DoNotContact::BOUNCED, $dnc->getReason()); | ||
|
@@ -70,7 +70,7 @@ public function testPostalCallbackProcessWithMessageBounced(): void | |
|
||
$dnc = $contact->getDoNotContact()->current(); | ||
Assert::assertSame('email', $dnc->getChannel()); | ||
Assert::assertSame('Delivery failed', $dnc->getComments()); | ||
Assert::assertSame('Hard bounce', $dnc->getComments()); | ||
Assert::assertSame($nowFormatted, $dnc->getDateAdded()->format(DateTimeHelper::FORMAT_DB)); | ||
Assert::assertSame($contact, $dnc->getLead()); | ||
Assert::assertSame(DoNotContact::BOUNCED, $dnc->getReason()); | ||
|
@@ -79,24 +79,22 @@ public function testPostalCallbackProcessWithMessageBounced(): void | |
/** | ||
* @return array<mixed> | ||
*/ | ||
private function getFailedParameters(): array | ||
private function getDeliveryFailedParameters(): array | ||
{ | ||
return [ | ||
[ | ||
'event' => 'MessageFailed', | ||
'payload' => [ | ||
'message' => [ | ||
'id' => '12345', | ||
'token' => 'abcdef123', | ||
'direction' => 'outgoing', | ||
'message_id' => '[email protected]', | ||
'to' => '[email protected]', | ||
'from' => '[email protected]', | ||
'subject' => 'Welcome to AwesomeApp', | ||
'timestamp' => 1477945177.12994, | ||
'spam_status' => 'NotSpam', | ||
'tag' => 'welcome', | ||
], | ||
'event' => 'MessageDeliveryFailed', | ||
'payload' => [ | ||
'message' => [ | ||
'id' => '12345', | ||
'token' => 'abcdef123', | ||
'direction' => 'outgoing', | ||
'message_id' => '[email protected]', | ||
'to' => '[email protected]', | ||
'from' => '[email protected]', | ||
'subject' => 'Welcome to AwesomeApp', | ||
'timestamp' => 1477945177.12994, | ||
'spam_status' => 'NotSpam', | ||
'tag' => 'welcome', | ||
], | ||
], | ||
]; | ||
|
@@ -108,32 +106,30 @@ private function getFailedParameters(): array | |
private function getBouncedParameters(): array | ||
{ | ||
return [ | ||
[ | ||
'event' => 'MessageBounced', | ||
'payload' => [ | ||
'original_message' => [ | ||
'id' => '12345', | ||
'token' => 'abcdef123', | ||
'direction' => 'outgoing', | ||
'message_id' => '[email protected]', | ||
'to' => '[email protected]', | ||
'from' => '[email protected]', | ||
'subject' => 'Welcome to AwesomeApp', | ||
'timestamp' => 1477945177.12994, | ||
'spam_status' => 'NotSpam', | ||
'tag' => 'welcome', | ||
], | ||
'bounce' => [ | ||
'id' => '12345', | ||
'token' => 'abcdef124', | ||
'direction' => 'incoming', | ||
'to' => '[email protected]', | ||
'from' => '[email protected]', | ||
'subject' => 'Delivery Error', | ||
'timestamp' => 1477945179.12994, | ||
'spam_status' => 'NotSpam', | ||
'tag' => null, | ||
], | ||
'event' => 'MessageBounced', | ||
'payload' => [ | ||
'original_message' => [ | ||
'id' => '12345', | ||
'token' => 'abcdef123', | ||
'direction' => 'outgoing', | ||
'message_id' => '[email protected]', | ||
'to' => '[email protected]', | ||
'from' => '[email protected]', | ||
'subject' => 'Welcome to AwesomeApp', | ||
'timestamp' => 1477945177.12994, | ||
'spam_status' => 'NotSpam', | ||
'tag' => 'welcome', | ||
], | ||
'bounce' => [ | ||
'id' => '12345', | ||
'token' => 'abcdef124', | ||
'direction' => 'incoming', | ||
'to' => '[email protected]', | ||
'from' => '[email protected]', | ||
'subject' => 'Delivery Error', | ||
'timestamp' => 1477945179.12994, | ||
'spam_status' => 'NotSpam', | ||
'tag' => null, | ||
], | ||
], | ||
]; | ||
|