TractorCow\Fluent\Tests\Middleware\Stub\DetectLocaleMiddlewareSpy
Opens up DetectLocaleMiddleware protected methods for unit testing
Synopsis
class DetectLocaleMiddlewareSpy
extends DetectLocaleMiddleware
implements
TestOnly
{
- // Inherited members from DetectLocaleMiddleware
- protected bool $cookiesPersisted;
- // methods
- public void __call()
- // Inherited methods from DetectLocaleMiddleware
- public void process()
- protected string getLocale()
- protected null|string getPersistLocale()
- protected $this setPersistLocale()
- protected string getPersistKey()
- protected mixed getParamLocale()
- protected string getDomainLocale()
- protected string getDetectedLocale()
- protected string getDefaultLocale()
- protected void validateAllowedLocale()
Hierarchy
Tasks
Line | Task |
---|---|
198+ | implement this. |
Members
protected
Methods
public
Inherited from TractorCow\Fluent\Middleware\DetectLocaleMiddleware
protected
- getDefaultLocale() — Get default locale
- getDetectedLocale() — Use the configured LocaleDetector to guess the locale
- getDomainLocale() — Get locale from the domain, if the current domain has exactly one locale
- getLocale() — Get the current locale from routing parameters, persistence, browser locale, etc
- getParamLocale() — Get locale from the query_param
- getPersistKey() — Get the Fluent locale persistence key. See the "persist_ids" config static.
- getPersistLocale() — Gets the locale currently set within either the session or cookie.
- setPersistLocale() — Specify the locale to persist between sessions, or to use for the locale outside of locale-routed pages (such as in unit tests, custom controllers, etc).
- validateAllowedLocale() — Check if the current user is allowed to access the curernt locale
public
- process() — Sets the current locale to the FluentState, provided no previous middleware has set it first