VuFind API Documentation

HtmlSafeJsonEncodeTest extends TestCase
in package
Uses ViewTrait

HtmlSafeJsonEncode View Helper Test Class

Tags
category

VuFind

author

Demian Katz demian.katz@villanova.edu

license

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

link

Wiki

Table of Contents

getJsonTests()  : array<string|int, mixed>
Data provider for JSON encoding tests
testCoreEncoding()  : void
Test escaping values without an outer helper enabled.
testDefaultEscaping()  : void
Test that the helper uses escapeHtmlAttr by default.
getHelper()  : HtmlSafeJsonEncode
Get helper to test
getPathForTheme()  : string
Get the directory for a given theme.
getPhpRenderer()  : PhpRenderer
Get a working renderer.
getSearchMemoryViewHelper()  : SearchMemory
Get mock SearchMemory view helper

Methods

getJsonTests()

Data provider for JSON encoding tests

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

testCoreEncoding()

Test escaping values without an outer helper enabled.

public testCoreEncoding(mixed $input, string $expectedOutput) : void
Parameters
$input : mixed

Input

$expectedOutput : string

Expected output

Tags
dataProvider

getJsonTests

Return values
void

testDefaultEscaping()

Test that the helper uses escapeHtmlAttr by default.

public testDefaultEscaping() : void
Return values
void

getPathForTheme()

Get the directory for a given theme.

protected getPathForTheme(string $theme) : string
Parameters
$theme : string

Theme directory name

Return values
string

getPhpRenderer()

Get a working renderer.

protected getPhpRenderer([array<string|int, mixed> $plugins = [] ][, string $theme = 'bootstrap3' ]) : PhpRenderer
Parameters
$plugins : array<string|int, mixed> = []

Custom VuFind plug-ins to register

$theme : string = 'bootstrap3'

Theme directory to load from

Return values
PhpRenderer

getSearchMemoryViewHelper()

Get mock SearchMemory view helper

protected getSearchMemoryViewHelper([Memory|null $memory = null ]) : SearchMemory
Parameters
$memory : Memory|null = null

Optional search memory

Return values
SearchMemory

Search results