Skip to content

Commit

Permalink
Follow up to receive_date convert to datepicker - update test
Browse files Browse the repository at this point in the history
  • Loading branch information
eileenmcnaughton committed Jun 24, 2019
1 parent d9efbd5 commit eb36081
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
8 changes: 3 additions & 5 deletions tests/phpunit/CRM/Contact/BAO/SavedSearchTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -184,23 +184,21 @@ public function testRelativeDateValues() {
'operator' => 'AND',
'event_relative' => 'this.month',
'participant_relative' => 'today',
'contribution_date_relative' => 'this.week',
'participant_test' => 0,
'title' => 'testsmart',
'radio_ts' => 'ts_all',
);
$queryParams = array();
$queryParams = [];
CRM_Contact_BAO_SavedSearch::saveRelativeDates($queryParams, $formValues);
CRM_Contact_BAO_SavedSearch::saveSkippedElement($queryParams, $formValues);
$savedSearch->form_values = serialize($queryParams);
$savedSearch->save();

$result = CRM_Contact_BAO_SavedSearch::getFormValues(CRM_Core_DAO::singleValueQuery('SELECT LAST_INSERT_ID()'));
$expectedResult = array(
$expectedResult = [
'event' => 'this.month',
'participant' => 'today',
'contribution' => 'this.week',
);
];
$this->checkArrayEquals($result['relative_dates'], $expectedResult);
}

Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/CiviTest/CiviUnitTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -1899,7 +1899,7 @@ public function getAndCheck($params, $id, $entity, $delete = 1, $errorText = '')
public function checkArrayEquals(&$actual, &$expected) {
self::unsetId($actual);
self::unsetId($expected);
$this->assertEquals($actual, $expected);
$this->assertEquals($expected, $actual);
}

/**
Expand Down

0 comments on commit eb36081

Please sign in to comment.