ContentPagesTest
extends TestCase
in package
Uses
ConfigPluginManagerTrait
ContentPages Plugin Test Class
Tags
Table of Contents
- $container : MockContainer
- Mock container
- $themeInfoData : array<string|int, mixed>
- Theme data for testing
- setUp() : void
- Standard setup method.
- testWithLanguages() : void
- Test URL generation with languages.
- testWithoutLanguages() : void
- Test URL generation without languages.
- getContentPages() : ContentPages
- Get a ContentPages object from its factory
- getMockConfigPluginManager() : MockObject|PluginManager
- Get a mock configuration plugin manager with the given configuration "files" available.
- getMockFailingConfigPluginManager() : MockObject|PluginManager
- Get a mock configuration plugin manager that will throw an exception.
- getMockRouter() : RouteStackInterface
- Get mock router object
- getMockThemeInfo() : ThemeInfo
- Get mock ThemeInfo object
Properties
$container
Mock container
protected
MockContainer
$container
= null
$themeInfoData
Theme data for testing
protected
array<string|int, mixed>
$themeInfoData
= ['templates/content/**/*.phtml' => [['theme' => 'bootstrap3', 'file' => '/themepath/templates/content/asklibrary_en.phtml', 'relativeFile' => 'templates/content/asklibrary_en.phtml'], ['theme' => 'bootstrap3', 'file' => '/themepath/templates/content/asklibrary.phtml', 'relativeFile' => 'templates/content/asklibrary.phtml'], ['theme' => 'bootstrap3', 'file' => '/themepath/templates/content/content.phtml', 'relativeFile' => 'templates/content/content.phtml'], ['theme' => 'bootstrap3', 'file' => '/themepath/templates/content/faq.phtml', 'relativeFile' => 'templates/content/faq.phtml'], ['theme' => 'bootstrap3', 'file' => '/themepath/templates/content/help/search.phtml', 'relativeFile' => 'templates/content/help/search.phtml'], ['theme' => 'bootstrap3', 'file' => '/themepath/templates/content/help/search_en.phtml', 'relativeFile' => 'templates/content/help/search_en.phtml'], ['theme' => 'bootstrap3', 'file' => '/themepath/templates/content/markdown.phtml', 'relativeFile' => 'templates/content/markdown.phtml']], 'templates/content/**/*.md' => [['theme' => 'bootstrap3', 'file' => '/themepath/templates/content/example.md', 'relativeFile' => 'templates/content/example.md']]]
Methods
setUp()
Standard setup method.
public
setUp() : void
Return values
void —testWithLanguages()
Test URL generation with languages.
public
testWithLanguages() : void
Return values
void —testWithoutLanguages()
Test URL generation without languages.
public
testWithoutLanguages() : void
Return values
void —getContentPages()
Get a ContentPages object from its factory
protected
getContentPages([array<string|int, mixed> $config = [] ][, RouteStackInterface|null $router = null ][, ThemeInfo|null $themeInfo = null ]) : ContentPages
Parameters
- $config : array<string|int, mixed> = []
-
Configuration
- $router : RouteStackInterface|null = null
-
Router object
- $themeInfo : ThemeInfo|null = null
-
ThemeInfo object
Return values
ContentPages —getMockConfigPluginManager()
Get a mock configuration plugin manager with the given configuration "files" available.
protected
getMockConfigPluginManager(array<string|int, mixed> $configs[, array<string|int, mixed> $default = [] ][, InvocationOrder|null $getExpect = null ][, InvocationOrder|null $hasExpect = null ]) : MockObject|PluginManager
Parameters
- $configs : array<string|int, mixed>
-
An associative array of configurations where key is the file (e.g. 'config') and value an array of configuration sections and directives
- $default : array<string|int, mixed> = []
-
Default configuration to return when no entry is found in $configs
- $getExpect : InvocationOrder|null = null
-
The expected invocation order for the get() method (null for any)
- $hasExpect : InvocationOrder|null = null
-
The expected invocation order for the has() method (null for any)
Return values
MockObject|PluginManager —getMockFailingConfigPluginManager()
Get a mock configuration plugin manager that will throw an exception.
protected
getMockFailingConfigPluginManager(Throwable $exception) : MockObject|PluginManager
Parameters
- $exception : Throwable
-
Exception to throw
Return values
MockObject|PluginManager —getMockRouter()
Get mock router object
protected
getMockRouter() : RouteStackInterface
Return values
RouteStackInterface —getMockThemeInfo()
Get mock ThemeInfo object
protected
getMockThemeInfo() : ThemeInfo