SampleTest
extends TestCase
in package
implements
HeadlessInterface, HookInterface, TransactionalInterface
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
Methods
- dataProvider() : array<string|int, mixed>
- Get data for tests.
- setUp() : void
- Set up for test.
- setUpHeadless() : CiviEnvBuilder
- Civi\Test has many helpers, like install(), uninstall(), sql(), and sqlFile(). See: https://github.com/civicrm/org.civicrm.testapalooza/blob/master/civi-test.md
- setupSampleData() : void
- Set up our sample data.
- testAll() : void
- Test CRM_Contact_Form_Search_Custom_Sample::all()
- testColumns() : void
- Test CRM_Contact_Form_Search_Custom_Group::columns().
- testContactIDs() : void
- Test CRM_Contact_Form_Search_Custom_Sample::contactIDs().
- testCount() : void
- Test CRM_Contact_Form_Search_Custom_Sample::count()
- testSavedSearch() : void
- Test CRM_Contact_Form_Search_Custom_Sample with saved_search_id With true argument it returns list of contact IDs
- testSummary() : void
- Test CRM_Contact_Form_Search_Custom_Group::summary() It returns NULL
- testTemplateFile() : void
- Test CRM_Contact_Form_Search_Custom_Sample::templateFile() Returns the path to the file as a string
- getContactIDs() : array<string|int, mixed>
- Get the ids for the relevant contacts.@
- setupSavedSearches() : void
- Set up saved searches.
Methods
dataProvider()
Get data for tests.
public
dataProvider() : array<string|int, mixed>
Return values
array<string|int, mixed>setUp()
Set up for test.
public
setUp() : void
Tags
setUpHeadless()
Civi\Test has many helpers, like install(), uninstall(), sql(), and sqlFile(). See: https://github.com/civicrm/org.civicrm.testapalooza/blob/master/civi-test.md
public
setUpHeadless() : CiviEnvBuilder
Return values
CiviEnvBuildersetupSampleData()
Set up our sample data.
public
setupSampleData() : void
Tags
testAll()
Test CRM_Contact_Form_Search_Custom_Sample::all()
public
testAll(array<string|int, mixed> $formValues, array<string|int, mixed> $names) : void
Parameters
- $formValues : array<string|int, mixed>
- $names : array<string|int, mixed>
Tags
testColumns()
Test CRM_Contact_Form_Search_Custom_Group::columns().
public
testColumns() : void
It returns an array of translated name => keys
testContactIDs()
Test CRM_Contact_Form_Search_Custom_Sample::contactIDs().
public
testContactIDs(array<string|int, mixed> $formValues, array<string|int, mixed> $names) : void
Parameters
- $formValues : array<string|int, mixed>
- $names : array<string|int, mixed>
Tags
testCount()
Test CRM_Contact_Form_Search_Custom_Sample::count()
public
testCount(array<string|int, mixed> $formValues, array<string|int, mixed> $names) : void
Parameters
- $formValues : array<string|int, mixed>
- $names : array<string|int, mixed>
Tags
testSavedSearch()
Test CRM_Contact_Form_Search_Custom_Sample with saved_search_id With true argument it returns list of contact IDs
public
testSavedSearch() : void
Tags
testSummary()
Test CRM_Contact_Form_Search_Custom_Group::summary() It returns NULL
public
testSummary() : void
testTemplateFile()
Test CRM_Contact_Form_Search_Custom_Sample::templateFile() Returns the path to the file as a string
public
testTemplateFile() : void
getContactIDs()
Get the ids for the relevant contacts.@
protected
getContactIDs(mixed $names) : array<string|int, mixed>
Parameters
- $names : mixed
Tags
Return values
array<string|int, mixed> —IDs of the contacts.
setupSavedSearches()
Set up saved searches.
protected
setupSavedSearches() : void