IconTest
extends TestCase
in package
Uses
ViewTrait
Icon View Helper Test Class
Tags
Table of Contents
- testAlias() : void
- Test that we can use an alias
- testCaching() : void
- Test that caching works correctly.
- testDirectCircularAlias() : void
- Test that we can detect a direct circular alias
- testFontIcon() : void
- Test that we can generate a font-based icon.
- testFontIconWithExtraClass() : void
- Test that we can generate a font-based icon with an extra class.
- testFontIconWithExtras() : void
- Test that we can generate a font-based icon with extra attributes.
- testImageIcon() : void
- Test that we can generate an image-based icon.
- testImageIconWithExtraClasses() : void
- Test that we can generate an image-based icon with extra classes in the configuration (including a class name with a colon in it).
- testImageIconWithExtras() : void
- Test that we can generate an image-based icon with extras.
- testImageIconWithSpecialChars() : void
- Test that we can generate an image-based icon where the icon contains a special character.
- testIndirectCircularAlias() : void
- Test that we can detect an indirect circular alias
- testRTL() : void
- Test RTL
- testSvgIcon() : void
- Test that we can generate an SVG icon.
- testSvgIconWithExtras() : void
- Test that we can generate an SVG icon with extras.
- testUnicodeIcons() : void
- Test that we can generate a Unicode icons.
- unicodeIconProvider() : array<string|int, mixed>
- Data provider for testUnicodeIcons
- getDefaultTestConfig() : array<string|int, mixed>
- Get a default test configuration.
- getIconHelper() : Icon
- Get an Icon helper
- getMockImageLink() : ImageLink
- Get a mock ImageLink helper
- getPathForTheme() : string
- Get the directory for a given theme.
- getPhpRenderer() : PhpRenderer
- Get a working renderer.
- getSearchMemoryViewHelper() : SearchMemory
- Get mock SearchMemory view helper
Methods
testAlias()
Test that we can use an alias
public
testAlias() : void
Return values
void —testCaching()
Test that caching works correctly.
public
testCaching() : void
Return values
void —testDirectCircularAlias()
Test that we can detect a direct circular alias
public
testDirectCircularAlias() : void
Return values
void —testFontIcon()
Test that we can generate a font-based icon.
public
testFontIcon() : void
Return values
void —testFontIconWithExtraClass()
Test that we can generate a font-based icon with an extra class.
public
testFontIconWithExtraClass() : void
Return values
void —testFontIconWithExtras()
Test that we can generate a font-based icon with extra attributes.
public
testFontIconWithExtras() : void
Return values
void —testImageIcon()
Test that we can generate an image-based icon.
public
testImageIcon() : void
Return values
void —testImageIconWithExtraClasses()
Test that we can generate an image-based icon with extra classes in the configuration (including a class name with a colon in it).
public
testImageIconWithExtraClasses() : void
Return values
void —testImageIconWithExtras()
Test that we can generate an image-based icon with extras.
public
testImageIconWithExtras() : void
Return values
void —testImageIconWithSpecialChars()
Test that we can generate an image-based icon where the icon contains a special character.
public
testImageIconWithSpecialChars() : void
Return values
void —testIndirectCircularAlias()
Test that we can detect an indirect circular alias
public
testIndirectCircularAlias() : void
Return values
void —testRTL()
Test RTL
public
testRTL() : void
Return values
void —testSvgIcon()
Test that we can generate an SVG icon.
public
testSvgIcon() : void
Return values
void —testSvgIconWithExtras()
Test that we can generate an SVG icon with extras.
public
testSvgIconWithExtras() : void
Return values
void —testUnicodeIcons()
Test that we can generate a Unicode icons.
public
testUnicodeIcons(string $expectedClasses, string $expectedAttrs, string $expectedIcon, string $icon, string|array<string|int, mixed> $attrs) : void
Parameters
- $expectedClasses : string
-
Expected extra classes
- $expectedAttrs : string
-
Expected extra attributes
- $expectedIcon : string
-
Expected icon code
- $icon : string
-
Icon alias
- $attrs : string|array<string|int, mixed>
-
Classes or attributes
Tags
Return values
void —unicodeIconProvider()
Data provider for testUnicodeIcons
public
static unicodeIconProvider() : array<string|int, mixed>
Return values
array<string|int, mixed> —getDefaultTestConfig()
Get a default test configuration.
protected
getDefaultTestConfig() : array<string|int, mixed>
Return values
array<string|int, mixed> —getIconHelper()
Get an Icon helper
protected
getIconHelper([array<string|int, mixed> $config = null ][, StorageInterface $cache = null ][, array<string|int, mixed> $plugins = [] ][, bool $rtl = false ]) : Icon
Parameters
- $config : array<string|int, mixed> = null
-
Icon helper configuration array
- $cache : StorageInterface = null
-
Cache storage adapter (null for BlackHole)
- $plugins : array<string|int, mixed> = []
-
Array of extra plugins for renderer
- $rtl : bool = false
-
Are we in right-to-left mode?
Return values
Icon —getMockImageLink()
Get a mock ImageLink helper
protected
getMockImageLink(string $expected) : ImageLink
Parameters
- $expected : string
-
Expected image
Return values
ImageLink —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