2 declare(strict_types = 1);
31 '/[[routePrefix]]/[[routeParameter]]',
40 'routePath' => $routePath,
43 ->withGenerateParameters([
45 ->withRequiredDefinedVariableNames(
'value'),
47 ->withResolveArguments([
49 'value' => $resolveValue
55 'routePath' => $routePath,
56 'namespace' =>
'testing',
59 ->withGenerateParameters([
61 ->withRequiredDefinedVariableNames(
'value'),
63 ->withResolveArguments([
66 'value' => $resolveValue,
75 'routePath' => $routePath,
76 '_controller' =>
'Link::index',
80 'extension' =>
'testing',
83 ->withGenerateParameters([
85 ->withRequiredDefinedVariableNames(
'value'),
86 '&tx_testing_link[controller]=Link&tx_testing_link[action]=index',
88 ->withResolveArguments([
90 'tx_testing_link' => [
91 'value' => $resolveValue,
94 'staticArguments' => [
95 'tx_testing_link' => [
96 'controller' =>
'Link',
109 $multipleTypesConfiguration = [
110 'type' =>
'PageType',
111 'default' =>
'.html',
119 $singleTypeConfiguration = [
120 'type' =>
'PageType',
130 ->withConfiguration($multipleTypesConfiguration)
131 ->withResolveArguments([
'pageType' => 0])
134 ->withConfiguration($multipleTypesConfiguration)
135 ->withGenerateParameters([
'&type=0'])
136 ->withResolveArguments([
'pageType' => 0])
139 ->withConfiguration($multipleTypesConfiguration)
140 ->withGenerateParameters([
'&type=10'])
141 ->withResolveArguments([
'pageType' => 10])
144 ->withConfiguration($multipleTypesConfiguration)
145 ->withGenerateParameters([
'&type=20'])
146 ->withResolveArguments([
'pageType' => 20])
149 ->withConfiguration($singleTypeConfiguration)
150 ->withResolveArguments([
'pageType' => 0])
153 ->withConfiguration($singleTypeConfiguration)
154 ->withGenerateParameters([
'&type=0'])
155 ->withResolveArguments([
'pageType' => 0])
162 $enhancerConfiguration = [];
164 foreach ($testSet->
getApplicables(EnhancerDeclaration::class) as $enhancerDeclaration) {
165 $enhancerConfiguration = array_replace_recursive(
166 $enhancerConfiguration,
173 foreach ($testSet->
getApplicables(AspectDeclaration::class) as $aspectDeclaration) {
174 $enhancerConfiguration[
'aspects'] = array_replace_recursive(
175 $enhancerConfiguration[
'aspects'] ?? [],
181 return $enhancerConfiguration;
186 $pageTypeConfiguration = [];
187 foreach ($testSet->
getApplicables(PageTypeDeclaration::class) as $pageTypeDeclaration) {
188 $pageTypeConfiguration = array_replace_recursive(
189 $pageTypeConfiguration,
195 return $pageTypeConfiguration;
200 $generateParameters = [];
202 foreach ($testSet->
getApplicables(HasGenerateParameters::class) as $applicable) {
203 $generateParameters[] = $applicable->getGenerateParameters();
208 return implode(
'', array_merge([], ...$generateParameters));
218 $resolveArguments = [];
220 foreach ($testSet->
getApplicables(HasResolveArguments::class) as $applicable) {
221 $resolveArguments = array_replace_recursive(
228 $resolveArguments[
'staticArguments'] = $resolveArguments[
'staticArguments'] ?? [];
229 $resolveArguments[
'dynamicArguments'] = $resolveArguments[
'dynamicArguments'] ?? [];
230 $resolveArguments[
'queryArguments'] = $resolveArguments[
'queryArguments'] ?? [];
232 $resolveArguments[
'routeArguments'] = $resolveArguments[
'routeArguments'] ?? array_replace_recursive(
233 $resolveArguments[
'staticArguments'],
234 $resolveArguments[
'dynamicArguments']
236 if (preg_match(
'#\?cHash=([a-z0-9]+)#i', $this->
compileUrl($testSet), $matches)) {
237 $resolveArguments[
'dynamicArguments'][
'cHash'] = $matches[1];
238 $resolveArguments[
'queryArguments'][
'cHash'] = $matches[1];
241 return $resolveArguments;