Skip to content

Commit

Permalink
Add test to check pcp notification is sent
Browse files Browse the repository at this point in the history
I wound up adding PcpBlock v4 api to write the test

In support of
#19096
  • Loading branch information
eileenmcnaughton committed Dec 5, 2020
1 parent da508f6 commit f6992e7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Civi/Api4/PcpBlock.php → Civi/Api4/PCPBlock.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@
*
* @package Civi\Api4
*/
class PcpBlock extends Generic\DAOEntity {
class PCPBlock extends Generic\DAOEntity {

}
4 changes: 1 addition & 3 deletions api/v3/utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion tests/phpunit/CRMTraits/PCP/PCPTestTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
*/

use Civi\Api4\Email;
use Civi\Api4\PCPBlock;

/**
* Trait CRMTraits_PCP_PCPTestTrait
Expand Down Expand Up @@ -86,7 +87,7 @@ public function pcpParams() {
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;
Expand Down

0 comments on commit f6992e7

Please sign in to comment.