Skip to content

Commit

Permalink
Alter test checking old save format
Browse files Browse the repository at this point in the history
  • Loading branch information
eileenmcnaughton committed Jun 24, 2019
1 parent eb36081 commit c9d7aba
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions tests/phpunit/CRM/Contact/BAO/SavedSearchTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,11 @@ public function testRelativeDateValues() {
/**
* Test relative dates
*
* The function saveRelativeDates should detect whether a field is using
* a relative date range and include in the fromValues a relative_date
* index so it is properly detects when executed.
* This is a slightly odd test because it was originally created to test that we DO create a
* special 'relative_dates' key but the new favoured format is not to do that and to
* save (eg) custom_1_relative = this.day.
*
* It still presumably provides useful 'this does not fatal or give enotice' coverage.
*/
public function testCustomFieldRelativeDates() {
// Create a custom field.
Expand Down Expand Up @@ -246,8 +248,7 @@ public function testCustomFieldRelativeDates() {
CRM_Contact_BAO_SavedSearch::saveRelativeDates($queryParams, $formValues);
// Since custom_13 doesn't have the word 'date' in it, the key is
// set to 0, rather than the field name.
$err = 'Relative date in custom field smart group creation failed.';
$this->assertArrayHasKey('relative_dates', $queryParams, $err);
$this->assertArrayNotHasKey('relative_dates', $queryParams, 'Relative date in custom field smart group creation failed.');
$dropCustomValueTables = TRUE;
$this->quickCleanup(array('civicrm_saved_search'), $dropCustomValueTables);
}
Expand Down

0 comments on commit c9d7aba

Please sign in to comment.