CookieConsentTest
extends TestCase
in package
Uses
FixtureTrait
Cookie Consent View Helper Test Class
Tags
Table of Contents
- testHelperInactive() : void
- Test inactive helper
- testHelperWithBadConsentRevision() : void
- Test helper with non-matching consent revision
- testHelperWithConsent() : void
- Test helper with consent
- testHelperWithoutConsent() : void
- Test helper without consent
- getConsentConfig() : array<string|int, mixed>
- Get cookie consent configuration
- getCookieConsent() : CookieConsent
- Create a CookieConsent helper
- getCookieManager() : CookieManager
- Get cookie manager
- getExpectedRenderParams() : array<string|int, mixed>
- Get expected params for the render call
- 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).
Methods
testHelperInactive()
Test inactive helper
public
testHelperInactive() : void
Return values
void —testHelperWithBadConsentRevision()
Test helper with non-matching consent revision
public
testHelperWithBadConsentRevision() : void
Return values
void —testHelperWithConsent()
Test helper with consent
public
testHelperWithConsent() : void
Return values
void —testHelperWithoutConsent()
Test helper without consent
public
testHelperWithoutConsent() : void
Return values
void —getConsentConfig()
Get cookie consent configuration
protected
getConsentConfig([string $filename = 'CookieConsent.yaml' ]) : array<string|int, mixed>
Parameters
- $filename : string = 'CookieConsent.yaml'
-
Consent config fixture name
Return values
array<string|int, mixed> —getCookieConsent()
Create a CookieConsent helper
protected
getCookieConsent(array<string|int, mixed> $config[, array<string|int, mixed> $cookies = [] ][, string $consentConfigName = 'CookieConsent.yaml' ]) : CookieConsent
Parameters
- $config : array<string|int, mixed>
-
Main configuration
- $cookies : array<string|int, mixed> = []
-
Cookies
- $consentConfigName : string = 'CookieConsent.yaml'
-
Consent config fixture name
Return values
CookieConsent —getCookieManager()
Get cookie manager
protected
getCookieManager(array<string|int, mixed> $config, array<string|int, mixed> $cookies) : CookieManager
Parameters
- $config : array<string|int, mixed>
-
Main configuration
- $cookies : array<string|int, mixed>
-
Cookies
Return values
CookieManager —getExpectedRenderParams()
Get expected params for the render call
protected
getExpectedRenderParams(string $consentConfigName, array<string|int, mixed> $config, array<string|int, mixed> $cookies) : array<string|int, mixed>
Parameters
- $consentConfigName : string
-
Consent config fixture name
- $config : array<string|int, mixed>
-
Main config
- $cookies : array<string|int, mixed>
-
Cookies
Return values
array<string|int, mixed> —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
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
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.