Update testGetActivityAccessCiviCRMEnough test for clarity
authoreileenmcnaugton <emcnaughton@wikimedia.org>
Fri, 10 May 2019 08:55:47 +0000 (20:55 +1200)
committereileenmcnaugton <emcnaughton@wikimedia.org>
Fri, 10 May 2019 08:59:32 +0000 (20:59 +1200)
tests/phpunit/api/v3/ACLPermissionTest.php

index f72b0a8818ffc4086b16d0631b44147465dbdee7..ff7534ff28cca03b375d409e40048220615772a7 100644 (file)
@@ -571,15 +571,19 @@ class api_v3_ACLPermissionTest extends CiviUnitTestCase {
   }
 
   /**
-   * View all activities is required unless id is passed in, in which case ACLs are used.
+   * Check the error message is not a permission error.
    */
-  public function testGetActivityAccessCiviCRMNotEnough() {
+  public function testGetActivityAccessCiviCRMEnough() {
     $activity = $this->activityCreate();
     $this->setPermissions(['access CiviCRM']);
     $this->callAPIFailure('Activity', 'getsingle', [
       'check_permissions' => 1,
       'id' => $activity['id'],
-    ]);
+    ], 'Expected one Activity but found 0');
+    $this->callAPISuccessGetCount('Activity', [
+      'check_permissions' => 1,
+      'id' => $activity['id'],
+    ], 0);
   }
 
   /**