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

SearchKit - Add 'array' option to download API and add test #21363

Merged
merged 1 commit into from
Sep 4, 2021

Conversation

colemanw
Copy link
Member

@colemanw colemanw commented Sep 3, 2021

Overview

This adds a new option to the SearchKit "Download" api to return a normal array result, which makes testing easier.

Before

Download api would directly output a file to the browser. No working unit test.

After

New option to not directly output file. Unit test works.

@civibot
Copy link

civibot bot commented Sep 3, 2021

(Standard links)

@civibot civibot bot added the master label Sep 3, 2021
@demeritcowboy
Copy link
Contributor

Looks good.

Minor notes:

  • The comment on line 64 is left over from an earlier iteration.
  • In terms of docs, I tried running what api explorer suggested: cv ev "$x = \Civi\Api4\SearchDisplay::download(FALSE)->setSavedSearch('abc')->setDisplay('def')->execute(); foreach ($x as $y) { print_r($y); }" but I was only able to get the header row. There is no setLimit(). I didn't bother looking further. The explorer itself does seem to return them all.

@demeritcowboy demeritcowboy merged commit 49d2b8c into civicrm:master Sep 4, 2021
@colemanw colemanw deleted the searchDownloadTest branch September 4, 2021 13:43
@colemanw
Copy link
Member Author

colemanw commented Sep 4, 2021

Thanks @demeritcowboy

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.

2 participants