Fix test
authorColeman Watts <coleman@civicrm.org>
Thu, 6 Jan 2022 19:32:11 +0000 (14:32 -0500)
committerColeman Watts <coleman@civicrm.org>
Sat, 8 Jan 2022 00:01:15 +0000 (19:01 -0500)
Test can give false failure depending on site's contact display_name settings.

tests/phpunit/api/v4/Action/ResultTest.php

index d9153c07d3c10a47c0da5bd3762a21fbde0c811e..c46547b6fb837641efbfe3324fdb891bee9ac61e 100644 (file)
@@ -45,24 +45,24 @@ class ResultTest extends UnitTestCase {
 
     $original = 'hello < you';
     $result = Contact::create(FALSE)
-      ->setValues(['display_name' => $original])
+      ->setValues(['first_name' => $original])
       ->execute()->first();
-    $this->assertEquals($original, $result['display_name'],
+    $this->assertEquals($original, $result['first_name'],
       "The value returned from Contact.create is different to the value sent."
     );
 
     $result = Contact::update(FALSE)
       ->addWhere('id', '=', $result['id'])
-      ->setValues(['display_name' => $original])
+      ->setValues(['first_name' => $original])
       ->execute()->first();
-    $this->assertEquals($original, $result['display_name'],
+    $this->assertEquals($original, $result['first_name'],
       "The value returned from Contact.update is different to the value sent."
     );
 
     $result = Contact::get(FALSE)
       ->addWhere('id', '=', $result['id'])
       ->execute()->first();
-    $this->assertEquals($original, $result['display_name'],
+    $this->assertEquals($original, $result['first_name'],
       "The value returned from Contact.get is different to the value sent."
     );
   }