Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tests #30

Merged
merged 40 commits into from
Mar 7, 2023
Merged

Fix tests #30

merged 40 commits into from
Mar 7, 2023

Conversation

n7studios
Copy link
Contributor

@n7studios n7studios commented Mar 2, 2023

Summary

  • Updates unit tests to be compatible with PHPUnit 9.x
  • Improves test coverage
  • Move environment configuration into .env files, instead of a hard coded PHP file
  • Defines the PSR-12 coding standard for tests
  • Adds a TESTING.MD file to advise how to write tests
  • Adds the pull request template, so future PR's are pre-populated with this style of content (summary, testing, checklist etc)
  • Adds a GitHub action to automatically run Coding Standard and Unit tests when a PR is created or merged

Testing

  • 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.
  • Tests for fetching a subscriber by email are removed for now, due to the inefficient get_subscriber_id() method attempting to fetch every single subscriber before finding a match by email (reported here, separate PR to follow to fix).

Checklist

@n7studios n7studios self-assigned this Mar 2, 2023
@n7studios n7studios requested review from a team, noelherrick and corydhmiller and removed request for a team March 2, 2023 18:16
@n7studios n7studios marked this pull request as ready for review March 2, 2023 18:16
@n7studios n7studios added this to the 1.0.0 milestone Mar 2, 2023
n7studios added 18 commits March 3, 2023 18:48
Fix `get_subscriber_id()` by email performance
This is no longer needed, as we query the API by `email_address`, so inspecting the response’s `total_subscribers` is sufficient.
…uest

Move `api_version` property into `make_request()`
…function

Replace `check_if_subscriber_in_array()` function
@n7studios n7studios merged commit c1b61a2 into 1.0-beta Mar 7, 2023
@n7studios n7studios deleted the fix-tests branch March 23, 2023 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant