Add test to check pcp notification is sent
authoreileen <emcnaughton@wikimedia.org>
Sat, 5 Dec 2020 23:00:26 +0000 (12:00 +1300)
committereileen <emcnaughton@wikimedia.org>
Sat, 5 Dec 2020 23:00:26 +0000 (12:00 +1300)
I wound up adding PcpBlock v4 api to write the test

In support of
#19096

Civi/Api4/PCPBlock.php [moved from Civi/Api4/PcpBlock.php with 94% similarity]
api/v3/utils.php
tests/phpunit/CRMTraits/PCP/PCPTestTrait.php

similarity index 94%
rename from Civi/Api4/PcpBlock.php
rename to Civi/Api4/PCPBlock.php
index 206a425bedf06d5598cc844f4a6caf935a4eaf3b..9fe55c0eb34ff84b35be5dc003a4f259bd2d9f7e 100644 (file)
@@ -23,6 +23,6 @@ namespace Civi\Api4;
  *
  * @package Civi\Api4
  */
-class PcpBlock extends Generic\DAOEntity {
+class PCPBlock extends Generic\DAOEntity {
 
 }
index b1858f77dc370d6c54cffe78ea1a39a5e16c94f8..6b8712d44bb09af2ebc8fd6d989477e5c4deaa9a 100644 (file)
@@ -334,9 +334,7 @@ function _civicrm_api3_get_DAO($name) {
   if ($name === 'Im' || $name === 'Acl' || $name === 'Pcp') {
     $name = strtoupper($name);
   }
-  if ($name === 'PcpBlock') {
-    $name = 'PCPBlock';
-  }
+
   $dao = CRM_Core_DAO_AllCoreTables::getFullName($name);
   if ($dao || !$name) {
     return $dao;
index 71d12ed7ee6c13cfc6948904b919b2ecc15fe718..31c58aeb9bdac25588c011105c19e4e821fc036d 100644 (file)
@@ -10,6 +10,7 @@
  */
 
 use Civi\Api4\Email;
+use Civi\Api4\PCPBlock;
 
 /**
  * Trait CRMTraits_PCP_PCPTestTrait
@@ -86,7 +87,7 @@ trait CRMTraits_PCP_PCPTestTrait {
   protected function createPCPBlock(array $params):int {
     $blockParams = $this->pcpBlockParams();
     $params = array_merge($this->pcpParams(), $params);
-    $params['pcp_block_id']  = \Civi\Api4\PcpBlock::create()->setValues($blockParams)->execute()->first()['id'];
+    $params['pcp_block_id']  = PCPBlock::create()->setValues($blockParams)->execute()->first()['id'];
 
     $pcp = CRM_PCP_BAO_PCP::create($params);
     return (int) $pcp->id;