From: eileen Date: Sat, 5 Dec 2020 23:00:26 +0000 (+1300) Subject: Add test to check pcp notification is sent X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=f6992e783087afe23e2f835263f2fdfb08a1f426;p=civicrm-core.git Add test to check pcp notification is sent I wound up adding PcpBlock v4 api to write the test In support of #19096 --- diff --git a/Civi/Api4/PcpBlock.php b/Civi/Api4/PCPBlock.php similarity index 94% rename from Civi/Api4/PcpBlock.php rename to Civi/Api4/PCPBlock.php index 206a425bed..9fe55c0eb3 100644 --- a/Civi/Api4/PcpBlock.php +++ b/Civi/Api4/PCPBlock.php @@ -23,6 +23,6 @@ namespace Civi\Api4; * * @package Civi\Api4 */ -class PcpBlock extends Generic\DAOEntity { +class PCPBlock extends Generic\DAOEntity { } diff --git a/api/v3/utils.php b/api/v3/utils.php index b1858f77dc..6b8712d44b 100644 --- a/api/v3/utils.php +++ b/api/v3/utils.php @@ -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; diff --git a/tests/phpunit/CRMTraits/PCP/PCPTestTrait.php b/tests/phpunit/CRMTraits/PCP/PCPTestTrait.php index 71d12ed7ee..31c58aeb9b 100644 --- a/tests/phpunit/CRMTraits/PCP/PCPTestTrait.php +++ b/tests/phpunit/CRMTraits/PCP/PCPTestTrait.php @@ -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;