* <http://www.gnu.org/licenses/>.
*/
+use Civi\Api4\OptionGroup;
use Civi\Payment\System;
+use Civi\Api4\OptionValue;
use League\Csv\Reader;
/**
*
* This can be used to test hooks within tests. For example in the ACL_PermissionTrait:
*
- * $this->hookClass->setHook('civicrm_aclWhereClause', array($this, 'aclWhereHookAllResults'));
+ * $this->hookClass->setHook('civicrm_aclWhereClause', [$this, 'aclWhereHookAllResults']);
*
* @var \CRM_Utils_Hook_UnitTests
*/
- public $hookClass = NULL;
+ public $hookClass;
/**
* @var array
* database population.
*
* @throws \CiviCRM_API3_Exception
+ * @throws \API_Exception
*/
public function createDomainContacts(): void {
$this->organizationCreate(['api.Email.create' => ['email' => 'fixme.domainemail@example.org']]);
'postal_code' => 6022,
],
]);
+ OptionValue::replace(FALSE)->addWhere(
+ 'option_group_id:name', '=', 'from_email_address'
+ )->setDefaults([
+ 'is_default' => 1,
+ 'name' => '"FIXME" <info@EXAMPLE.ORG>',
+ 'label' => '"FIXME" <info@EXAMPLE.ORG>',
+ ])->setRecords([['domain_id' => 1], ['domain_id' => 2]])->execute();
}
/**
/**
* CHeck that all tests that have created payments have created them with the right financial entities.
*
+ * @throws \API_Exception
* @throws \CRM_Core_Exception
*/
protected function assertPostConditions() {
if ($this->isLocationTypesOnPostAssert) {
$this->assertLocationValidity();
}
+ $this->assertCount(1, OptionGroup::get(FALSE)
+ ->addWhere('name', '=', 'from_email_address')
+ ->execute());
if (!$this->isValidateFinancialsOnPostAssert) {
return;
}