ContributionRecurTest
extends TestCase
in package
implements
HeadlessInterface, HookInterface, TransactionalInterface
uses
EntityTrait
FIXME - Add test description.
Tips:
- With HookInterface, you may implement CiviCRM hooks directly in the test class. Simply create corresponding functions (e.g. "hook_civicrm_post(...)" or similar).
- With TransactionalInterface, any data changes made by setUp() or test****() functions will rollback automatically -- as long as you don't manipulate schema or truncate tables. If this test needs to manipulate schema or truncate tables, then either: a. Do all that using setupHeadless() and Civi\Test. b. Disable TransactionalInterface, and handle all setup/teardown yourself.
Tags
Table of Contents
Interfaces
- HeadlessInterface
- Interface HeadlessInterface
- HookInterface
- TransactionalInterface
- Interface HeadlessInterface
Properties
- $ids : array<string|int, mixed>
- Array of IDs created to support the test.
- $tablesToCleanUp : array<string|int, mixed>
- Track tables we have modified during a test.
- $testRecords : array<string|int, mixed>
- Records created which will be deleted during tearDown
Methods
- setUpHeadless() : CiviEnvBuilder
- Setup used when HeadlessInterface is implemented.
- testCurrencyFill() : void
- testDuplicateCheck() : void
- createTestEntity() : array<string|int, mixed>
- Create an entity, recording it's details for tearDown.
- setTestEntity() : void
- Set the test entity on the class for access.
- setTestEntityID() : void
Properties
$ids
Array of IDs created to support the test.
protected
array<string|int, mixed>
$ids
= []
e.g $this->ids = ['Event' => ['descriptive_key' => $eventID], 'Group' => [$groupID]];
$tablesToCleanUp
Track tables we have modified during a test.
protected
array<string|int, mixed>
$tablesToCleanUp
= []
Set up functions that add entities can register the relevant tables here for the cleanup process.
$testRecords
Records created which will be deleted during tearDown
protected
array<string|int, mixed>
$testRecords
= []
Methods
setUpHeadless()
Setup used when HeadlessInterface is implemented.
public
setUpHeadless() : CiviEnvBuilder
Civi\Test has many helpers, like install(), uninstall(), sql(), and sqlFile().
Tags
Return values
CiviEnvBuildertestCurrencyFill()
public
testCurrencyFill() : void
Tags
testDuplicateCheck()
public
testDuplicateCheck() : void
Tags
createTestEntity()
Create an entity, recording it's details for tearDown.
protected
createTestEntity(string $entity, array<string|int, mixed> $values[, string $identifier = 'default' ]) : array<string|int, mixed>
Parameters
- $entity : string
- $values : array<string|int, mixed>
- $identifier : string = 'default'
Return values
array<string|int, mixed>setTestEntity()
Set the test entity on the class for access.
protected
setTestEntity(string $entity, array<string|int, mixed> $values, string $identifier) : void
This follows the ids patter and also the api4TestTrait pattern.
Parameters
- $entity : string
- $values : array<string|int, mixed>
- $identifier : string
setTestEntityID()
protected
setTestEntityID(string $entity, int $id, string $identifier) : void
Parameters
- $entity : string
- $id : int
- $identifier : string