VuFind API Documentation

FormTest extends TestCase
in package
Uses FixtureTrait

Form Test Class

Tags
category

VuFind

author

Demian Katz demian.katz@villanova.edu

author

Juha Luoma juha.luoma@helsinki.fi

license

http://opensource.org/licenses/gpl-2.0.php GNU General Public License

link

Wiki

Table of Contents

$mockTestFormYamlReader  : mixed
getEmailSubjectsData()  : array<string|int, mixed>
Function to get testEmailSubjects data.
testCheckboxRequiredValidators()  : void
Test checkbox element 'required' and 'requireOne' option validators.
testDefaultsWithConfiguration()  : void
Test defaults with defaults passed to constructor.
testDefaultsWithFormSet()  : void
Test defaults with no configuration.
testDefaultsWithoutConfiguration()  : void
Test defaults with no configuration.
testElementOptions()  : void
Test element options (select, radio, checkbox).
testElementOptionValueValidators()  : void
Test element option value validators (select, radio, checkbox).
testEmailSubjects()  : void
Test email subjects.
testPrefill()  : void
Test prefilling values for inputs from form configuration
testPrefillProtectedFields()  : void
Test protecting fields from being prefilled
testSenderFieldMerging()  : void
Test sender field merging.
testSenderFieldMergingWithSettings()  : void
Test sender field merging.
testUndefinedFormId()  : void
Test that the class blocks unknown form IDs.
getFixture()  : string
Load a fixture file.
getFixtureDir()  : string
Get the base directory containing fixtures.
getFixturePath()  : string
Resolve fixture path.
getJsonFixture()  : array<string|int, mixed>
Load a JSON fixture from file (using associative array return type).
getMockTestForm()  : Form
Get a mock Form object.
getMockTestFormYamlReader()  : YamlReader
Get a mock YamlReader object.

Properties

$mockTestFormYamlReader

protected mixed $mockTestFormYamlReader = null

Methods

getEmailSubjectsData()

Function to get testEmailSubjects data.

public static getEmailSubjectsData() : array<string|int, mixed>
Return values
array<string|int, mixed>

testCheckboxRequiredValidators()

Test checkbox element 'required' and 'requireOne' option validators.

public testCheckboxRequiredValidators() : void
Return values
void

testDefaultsWithConfiguration()

Test defaults with defaults passed to constructor.

public testDefaultsWithConfiguration() : void
Return values
void

testDefaultsWithFormSet()

Test defaults with no configuration.

public testDefaultsWithFormSet() : void
Return values
void

testDefaultsWithoutConfiguration()

Test defaults with no configuration.

public testDefaultsWithoutConfiguration() : void
Return values
void

testElementOptions()

Test element options (select, radio, checkbox).

public testElementOptions() : void
Return values
void

testElementOptionValueValidators()

Test element option value validators (select, radio, checkbox).

public testElementOptionValueValidators() : void
Return values
void

testEmailSubjects()

Test email subjects.

public testEmailSubjects(string $formToTest, string $expectedSubject) : void
Parameters
$formToTest : string

ID of the form to test.

$expectedSubject : string

String to be expected.

Tags
dataProvider

getEmailSubjectsData

Return values
void

testPrefill()

Test prefilling values for inputs from form configuration

public testPrefill() : void
Return values
void

testPrefillProtectedFields()

Test protecting fields from being prefilled

public testPrefillProtectedFields() : void
Return values
void

testSenderFieldMerging()

Test sender field merging.

public testSenderFieldMerging() : void
Return values
void

testSenderFieldMergingWithSettings()

Test sender field merging.

public testSenderFieldMergingWithSettings() : void
Return values
void

testUndefinedFormId()

Test that the class blocks unknown form IDs.

public testUndefinedFormId() : void
Return values
void

getFixture()

Load a fixture file.

protected getFixture(string $filename[, string $module = 'VuFind' ]) : string
Parameters
$filename : string

Filename relative to fixture directory.

$module : string = 'VuFind'

Module containing fixture.

Tags
throws
RuntimeException
Return values
string

getFixtureDir()

Get the base directory containing fixtures.

protected getFixtureDir([string $module = 'VuFind' ]) : string
Parameters
$module : string = 'VuFind'

Module containing fixture.

Return values
string

getFixturePath()

Resolve fixture path.

protected getFixturePath(string $filename[, string $module = 'VuFind' ]) : string
Parameters
$filename : string

Filename relative to fixture directory.

$module : string = 'VuFind'

Module containing fixture.

Tags
throws
RuntimeException
Return values
string

getJsonFixture()

Load a JSON fixture from file (using associative array return type).

protected getJsonFixture(string $filename[, string $module = 'VuFind' ]) : array<string|int, mixed>
Parameters
$filename : string

Filename relative to fixture directory.

$module : string = 'VuFind'

Module containing fixture.

Return values
array<string|int, mixed>

getMockTestForm()

Get a mock Form object.

protected getMockTestForm(string $formId[, array<string|int, mixed> $params = [] ][, array<string|int, mixed> $prefill = [] ]) : Form
Parameters
$formId : string

Form identifier

$params : array<string|int, mixed> = []

Parameters to pass to setFormId

$prefill : array<string|int, mixed> = []

Prefill data to pass to setFormId

Tags
throws
Exception
Return values
Form

Search results