PHP Class Contao\CoreBundle\Test\EventListener\LocaleListenerTest

Inheritance: extends Contao\CoreBundle\Test\TestCase
Datei anzeigen Open project: contao/core-bundle

Public Methods

Method Description
acceptLanguageTestData ( ) : array Provides the test data for the accept language header tests.
localeTestData ( ) : array Provides the test data for the locale tests.
testCreateWithLocales ( ) Tests the createWithLocales() method.
testInstantiation ( ) Tests the object instantiation.
testInvalidLocale ( ) Tests the onKernelRequest() method with an invalid locale.
testWithLanguageHeader ( string $locale, string $expected, array $available ) Tests the onKernelRequest() method with an accept language header.
testWithRequestAttribute ( string $locale, string $expected ) Tests the onKernelRequest() method with a request attribute.
testWithSessionValue ( string $locale, string $expected ) Tests the onKernelRequest() method with the session locale.
testWithoutContainer ( ) Tests the onKernelRequest() method without container.
testWithoutSession ( string $locale, string $expected ) Tests the onKernelRequest() method without session.

Method Details

acceptLanguageTestData() public method

Provides the test data for the accept language header tests.
public acceptLanguageTestData ( ) : array
return array

localeTestData() public method

Provides the test data for the locale tests.
public localeTestData ( ) : array
return array

testCreateWithLocales() public method

Tests the createWithLocales() method.

testInstantiation() public method

Tests the object instantiation.
public testInstantiation ( )

testInvalidLocale() public method

Tests the onKernelRequest() method with an invalid locale.
public testInvalidLocale ( )

testWithLanguageHeader() public method

Tests the onKernelRequest() method with an accept language header.
public testWithLanguageHeader ( string $locale, string $expected, array $available )
$locale string
$expected string
$available array

testWithRequestAttribute() public method

Tests the onKernelRequest() method with a request attribute.
public testWithRequestAttribute ( string $locale, string $expected )
$locale string
$expected string

testWithSessionValue() public method

Tests the onKernelRequest() method with the session locale.
public testWithSessionValue ( string $locale, string $expected )
$locale string
$expected string

testWithoutContainer() public method

Tests the onKernelRequest() method without container.

testWithoutSession() public method

Tests the onKernelRequest() method without session.
public testWithoutSession ( string $locale, string $expected )
$locale string
$expected string