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

Add unit tests #8

Open
wants to merge 25 commits into
base: master
Choose a base branch
from
Open

Conversation

gradinarufelix
Copy link
Contributor

  1. Run composer install
  2. Run composer test

Copy link
Contributor

@krsriq krsriq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is coming together quite nicely! Just a couple of cleanup tasks.

Depending on how far you want to go with this, there are a couple of obvious refactoring opportunities here

  • the $from/$to parsing in getRecordings could be moved to a separate method (code repetition, and getRecordings is kind of long and does a lot imo)
  • move getAccessToken to a separate class (kind of smelly that this can't be tested..)

Tests/Unit/ZoomApiServiceTest.php Show resolved Hide resolved
Classes/Domain/Service/ZoomApiService.php Outdated Show resolved Hide resolved
Classes/Domain/Service/ZoomApiService.php Outdated Show resolved Hide resolved
Tests/Unit/ZoomApiServiceTest.php Outdated Show resolved Hide resolved
Tests/Unit/ZoomApiServiceTest.php Outdated Show resolved Hide resolved
Tests/Unit/ZoomApiServiceTest.php Outdated Show resolved Hide resolved
Tests/ZoomApiServiceTest.php Outdated Show resolved Hide resolved
Classes/Domain/Service/ZoomApiService.php Outdated Show resolved Hide resolved
@krsriq krsriq force-pushed the switch-to-s2s-oauth-apps-tests branch 2 times, most recently from 65e9173 to 11ee4bd Compare September 27, 2023 18:52
@codecov
Copy link

codecov bot commented Sep 27, 2023

Welcome to Codecov 🎉

Once merged to your default branch, Codecov will compare your coverage reports and display the results in this comment.

Thanks for integrating Codecov - We've got you covered ☂️

@krsriq krsriq force-pushed the switch-to-s2s-oauth-apps-tests branch from 11ee4bd to 1092669 Compare September 27, 2023 18:53
@krsriq krsriq force-pushed the switch-to-s2s-oauth-apps-tests branch from 1092669 to 69a074c Compare September 27, 2023 20:22
@gradinarufelix
Copy link
Contributor Author

Review again. I moved the getAccessToken to a separate class.

Copy link
Contributor

@krsriq krsriq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Getting there - the main service class looks much cleaner now.

I've added a (now failing) test to make you aware of an issue that would not have become apparent without that test - see comments!

Classes/Domain/Service/ZoomApiService.php Outdated Show resolved Hide resolved
Tests/Unit/ZoomApiAccessTokenFactoryTest.php Outdated Show resolved Hide resolved
Tests/Unit/ZoomApiServiceTest.php Show resolved Hide resolved
Classes/Domain/Service/ZoomApiAccessTokenFactory.php Outdated Show resolved Hide resolved
Classes/Domain/Service/ZoomApiAccessTokenFactory.php Outdated Show resolved Hide resolved
Tests/Unit/ZoomApiServiceTest.php Outdated Show resolved Hide resolved
Classes/Domain/Service/ZoomApiService.php Outdated Show resolved Hide resolved
Classes/Domain/Service/ZoomApiService.php Outdated Show resolved Hide resolved
@gradinarufelix gradinarufelix requested a review from krsriq October 3, 2023 09:52
Copy link
Contributor

@krsriq krsriq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found a couple more bugs.
After these are fixed I think we're done here!

@@ -236,51 +224,13 @@ private function fetchPaginatedData(string $uri, string $paginatedDataKey): arra
throw new ZoomApiException(sprintf('Could not fetch Zoom paginated data for data key "%s", returned status "%s"', $paginatedDataKey, $response->getStatusCode()), 1695239983421);
Copy link
Contributor

@krsriq krsriq Oct 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line is still suspiciously not covered by tests - and has a bug (guess you can find it on your own ;) ).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sollte jetzt gefixt sein, was meinst du? ;-)

Ich habe jetzt auch noch PHPStan hinzugefügt und Codesniffer

Classes/Domain/Model/ZoomApiAccessToken.php Outdated Show resolved Hide resolved
@gradinarufelix gradinarufelix requested a review from krsriq October 4, 2023 08:23
@gradinarufelix gradinarufelix force-pushed the switch-to-s2s-oauth-apps-tests branch from b0a1310 to 9fbf997 Compare October 4, 2023 10:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants