Merge pull request #22808 from colemanw/searchKitMailingTask
[civicrm-core.git] / Civi / Test / ContactTestTrait.php
index bd8d5bb16fcf21a708805d6274ca09a2b089f072..1aced05b679fcd91a311188f71ae20c24b0bcabd 100644 (file)
@@ -23,7 +23,6 @@ trait ContactTestTrait {
    *
    * @return int
    *   Contact ID of the created user.
-   * @throws \CiviCRM_API3_Exception
    */
   public function createLoggedInUser(): int {
     $params = [
@@ -55,8 +54,6 @@ trait ContactTestTrait {
    *
    * @return int
    *   id of Organisation created
-   *
-   * @throws \CiviCRM_API3_Exception
    */
   public function organizationCreate($params = [], $seq = 0): int {
     if (!$params) {
@@ -77,12 +74,11 @@ trait ContactTestTrait {
    *
    * @return int
    *   id of Individual created
-   *
-   * @throws \CiviCRM_API3_Exception
    */
-  public function individualCreate($params = [], $seq = 0, $random = FALSE): int {
+  public function individualCreate(array $params = [], $seq = 0, $random = FALSE): int {
     $params = array_merge($this->sampleContact('Individual', $seq, $random), $params);
-    return $this->_contactCreate($params);
+    $this->ids['Contact']['individual_' . $seq] = $this->_contactCreate($params);
+    return $this->ids['Contact']['individual_' . $seq];
   }
 
   /**