diff --git a/tests/phpunit/CRM/Mailing/Form/Task/AdhocMailingTest.php b/tests/phpunit/CRM/Mailing/Form/Task/AdhocMailingTest.php index 5277f5a69e79..7d196ada74f9 100644 --- a/tests/phpunit/CRM/Mailing/Form/Task/AdhocMailingTest.php +++ b/tests/phpunit/CRM/Mailing/Form/Task/AdhocMailingTest.php @@ -44,8 +44,9 @@ public function testCreateHiddenGroupFromSearchBuilder() { catch (CRM_Core_Exception_PrematureExitException $e) { // Nothing to see here. } - $savedSearch = $this->callAPISuccessGetSingle('SavedSearch', ['where' => [['has_base', '=', FALSE]]]); - $this->assertEquals($formValues, $savedSearch['form_values']); + $savedSearch = $this->callAPISuccess('SavedSearch', 'get', ['sequential' => 1, 'options' => ['sort' => "id DESC"]]); + $this->assertGreaterThan(0, $savedSearch['count']); + $this->assertEquals($formValues, $savedSearch['values'][0]['form_values']); } }