HtmlSafeJsonEncodeTest
extends TestCase
in package
Uses
ViewTrait
HtmlSafeJsonEncode View Helper Test Class
Tags
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
Return values
void —testDefaultEscaping()
Test that the helper uses escapeHtmlAttr by default.
public
testDefaultEscaping() : void
Return values
void —getHelper()
Get helper to test
protected
getHelper([array<string|int, mixed> $plugins = [] ]) : HtmlSafeJsonEncode
Parameters
- $plugins : array<string|int, mixed> = []
-
Array of extra plugins for renderer
Return values
HtmlSafeJsonEncode —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