Skip to content

Conversation

n7studios
Copy link
Contributor

@n7studios n7studios commented Mar 3, 2023

Summary

When calling get_subscriber_id(), includes the email_address as an argument, instead of attempting to fetch every single subscriber and then iterating through the array of subscribers to find a match.

Fixes:

testGetResource fails, due to code using a third party library that's reliant on the (not recommended) file_get_contents(). A separate PR to fix the code will result in this test passing.

Testing

  • testGetSubscriberID: Tests that fetching a subscriber ID by email address works when a valid subscriber email address is supplied
  • testGetSubscriberIDWithInvalidEmailAddress: Tests that an InvalidArgumentException is thrown when an invalid email address is supplied
  • testGetSubscriberIDWithNotSubscribedEmailAddress: Tests that fetching a subscriber ID by email address returns false when a valid email address is supplied, but is not a subscriber

Checklist

@n7studios n7studios changed the title Fix get_subscriber_id() by email performance Fix get_subscriber_id() by email performance Mar 3, 2023
@n7studios n7studios merged commit 78262b4 into fix-tests Mar 6, 2023
@n7studios n7studios deleted the fix-get-subscriber-id-performance branch March 23, 2023 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants