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 tests for listContents endpoint #16

Merged
merged 5 commits into from
May 17, 2024
Merged

Conversation

vermakhushboo
Copy link
Member

No description provided.

return array_map(static function ($item) {
return $item['name'];
}, $response['body']);
if (isset($response['body'][0])) {
Copy link
Member

Choose a reason for hiding this comment

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

What is the data that we expect here? is it possible that sometime we'll get it as array and sometimes as an object?

Copy link
Member Author

Choose a reason for hiding this comment

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

If you enter a path like src, it returns an array of arrays with each file/ folder details.
If you enter an absolute path of a file like README.md, it returns an array with the details of the file, instead of array of array.
If you enter a path that has no files, like an empty repo, it returns an empty array.

@christyjacob4 christyjacob4 merged commit e538264 into main May 17, 2024
3 checks passed
@christyjacob4 christyjacob4 deleted the add-tests-for-list-contents branch May 17, 2024 09:36
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.

3 participants