Documentation

CRMTraits_Page_PageTestTrait

Trait CRMTraits_Page_PageTestTrait

Trait for testing quickform pages in unit tests.

Table of Contents

Properties

$context  : mixed
$page  : CRM_Core_Page
$pageContent  : string
Content from the rendered page.
$smartyVariables  : array<string|int, mixed>
Variables assigned to smarty.
$tplName  : string

Methods

checkPageContent()  : mixed
assertPageContains()  : mixed
Assert that the page output contains the expected strings.
assertSmartyVariableArrayIncludes()  : mixed
Check an array assigned to smarty for the inclusion of the expected variables.
assertSmartyVariables()  : mixed
Assert that the expected variables have been assigned to Smarty.
listenForPageContent()  : mixed
Set up environment to listen for page content.

Properties

$pageContent

Content from the rendered page.

protected string $pageContent

$smartyVariables

Variables assigned to smarty.

protected array<string|int, mixed> $smartyVariables = []

Methods

checkPageContent()

public checkPageContent(string &$content, string $context, string $tplName, CRM_Core_Page &$object) : mixed
Parameters
$content : string
$context : string
$tplName : string
$object : CRM_Core_Page

assertPageContains()

Assert that the page output contains the expected strings.

protected assertPageContains(mixed $expectedStrings) : mixed
Parameters
$expectedStrings : mixed

assertSmartyVariableArrayIncludes()

Check an array assigned to smarty for the inclusion of the expected variables.

protected assertSmartyVariableArrayIncludes(string $variableName, mixed $index, mixed $expected) : mixed
Parameters
$variableName : string
$index : mixed
$expected : mixed

assertSmartyVariables()

Assert that the expected variables have been assigned to Smarty.

protected assertSmartyVariables(mixed $expectedVariables) : mixed
Parameters
$expectedVariables : mixed

listenForPageContent()

Set up environment to listen for page content.

protected listenForPageContent() : mixed

        
On this page

Search results