1

I created a patch for CiviCRM that allows saved searches to be created using the API.

Now it turns out that this SavedSearch API does not pass certain syntax conformance unit tests.

One of the problem is that some of the tests try to create a new saved search, and they try to assign a string like form_values_273form_values_576 to the form_values field of the saved search entity.

The saved search BAO expect form_values to be a serialized array, and because form_values_273form_values_576 obviously is not, errors occur, causing some the unit tests to fail. (see e.g. line 239 of /CRM/Contact/BAO/SavedSearch.php)

Is there a way to make those unit tests use a sensible value for form_value? NULL should do as well, I guess.

1

1 Answer 1

1

For most of the tests, it was sufficient to provide an assignTestValue method in the SavedSearch BAO.

This did not solve the problem though for testCreateSingleValueAlter.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.