Skip to content

Commit

Permalink
Merge pull request #31805 from colemanw/spookyTestFix
Browse files Browse the repository at this point in the history
SearchKit - Fix unit test assumptions
  • Loading branch information
colemanw authored Jan 16, 2025
2 parents 2c9c157 + ffd4dcf commit 9769d21
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1330,15 +1330,16 @@ public function testCssRules() {
public function testIcons() {
$subject = uniqid(__FUNCTION__);

$source = Contact::create(FALSE)->execute()->first();
$source = $this->createTestRecord('Contact');

$activities = [
['activity_type_id:name' => 'Meeting', 'subject' => $subject, 'status_id:name' => 'Scheduled'],
['activity_type_id:name' => 'Phone Call', 'subject' => $subject, 'status_id:name' => 'Completed'],
];
Activity::save(FALSE)
->addDefault('source_contact_id', $source['id'])
->setRecords($activities)->execute();
$this->saveTestRecords('Activity', [
'defaults' => ['source_contact_id' => $source['id']],
'records' => $activities,
]);

$search = [
'api_entity' => 'Activity',
Expand All @@ -1348,7 +1349,9 @@ public function testIcons() {
'id',
],
'orderBy' => [],
'where' => [],
'where' => [
['subject', '=', $subject],
],
'groupBy' => [],
'join' => [],
'having' => [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ public function testJoinWithCustomFieldEndingIn_() {
'GROUP_CONCAT(DISTINCT Contact_ActivityContact_Activity_01.testactivity2.testactivity_:label) AS GROUP_CONCAT_Contact_ActivityContact_Activity_01_testactivity2_testactivity__label',
],
'orderBy' => [],
'where' => [['contact_type:name', '=', 'Individual']],
'where' => [['id', '=', $contact['id']]],
'groupBy' => ['id'],
'join' => [
['Activity AS Contact_ActivityContact_Activity_01', 'INNER', 'ActivityContact',
Expand Down

0 comments on commit 9769d21

Please sign in to comment.