‪TYPO3CMS  9.5
RequestBuilderTest.php
Go to the documentation of this file.
1 <?php
2 declare(strict_types = 1);
3 
5 
6 /*
7  * This file is part of the TYPO3 CMS project.
8  *
9  * It is free software; you can redistribute it and/or modify it under
10  * the terms of the GNU General Public License, either version 2
11  * of the License, or any later version.
12  *
13  * For the full copyright and license information, please read the
14  * LICENSE.txt file that was distributed with this source code.
15  *
16  * The TYPO3 project - inspiring people to share!
17  */
28 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
29 
33 class ‪RequestBuilderTest extends UnitTestCase
34 {
38  protected ‪$requestBuilder;
39 
44 
48  protected ‪$configuration;
49 
54 
58  protected ‪$mockExtensionService;
59 
64 
68  protected ‪$mockRequest;
69 
73  protected function ‪setUp(): void
74  {
75  $this->requestBuilder = $this->getAccessibleMock(RequestBuilder::class, ['dummy']);
76  $this->configuration = [
77  'userFunc' => 'Tx_Extbase_Dispatcher->dispatch',
78  'pluginName' => 'Pi1',
79  'extensionName' => 'MyExtension',
80  'controller' => 'TheFirstController',
81  'action' => 'show',
82  'controllerConfiguration' => [
83  'TheFirstController' => [
84  'actions' => ['show', 'index', 'new', 'create', 'delete', 'edit', 'update', 'setup', 'test']
85  ],
86  'TheSecondController' => [
87  'actions' => ['show', 'index']
88  ],
89  'TheThirdController' => [
90  'actions' => ['delete', 'create', 'onlyInThirdController']
91  ]
92  ]
93  ];
94  $this->mockConfigurationManager = $this->createMock(ConfigurationManagerInterface::class);
95  $this->mockRequest = $this->createMock(Request::class);
96  $this->mockObjectManager = $this->createMock(ObjectManagerInterface::class);
97  $this->mockExtensionService = $this->createMock(ExtensionService::class);
98  $this->mockEnvironmentService = $this->getMockBuilder(EnvironmentService::class)
99  ->setMethods(['getServerRequestMethod'])
100  ->getMock();
101  }
102 
105  protected function ‪injectDependencies(): void
106  {
107  $this->mockConfigurationManager->expects($this->any())->method('getConfiguration')->will($this->returnValue($this->configuration));
108  $this->requestBuilder->_set('configurationManager', $this->mockConfigurationManager);
109  $this->mockObjectManager->expects($this->any())->method('get')->with(Request::class)->will($this->returnValue($this->mockRequest));
110  $this->requestBuilder->_set('objectManager', $this->mockObjectManager);
111  $pluginNamespace = 'tx_' . strtolower($this->configuration['extensionName'] . '_' . $this->configuration['pluginName']);
112  $this->mockExtensionService->expects($this->any())->method('getPluginNamespace')->will($this->returnValue($pluginNamespace));
113  $this->requestBuilder->_set('extensionService', $this->mockExtensionService);
114  $this->mockEnvironmentService->expects($this->any())->method('getServerRequestMethod')->will($this->returnValue('GET'));
115  $this->requestBuilder->_set('environmentService', $this->mockEnvironmentService);
116  }
117 
121  public function ‪buildReturnsAWebRequestObject(): void
122  {
123  $this->‪injectDependencies();
124  $request = $this->requestBuilder->build();
125  $this->assertSame($this->mockRequest, $request);
126  }
127 
131  public function ‪buildSetsRequestPluginName(): void
132  {
133  $this->‪injectDependencies();
134  $this->mockRequest->expects($this->once())->method('setPluginName')->with('Pi1');
135  $this->requestBuilder->build();
136  }
137 
141  public function ‪buildSetsRequestControllerExtensionName(): void
142  {
143  $this->‪injectDependencies();
144  $this->mockRequest->expects($this->once())->method('setControllerExtensionName')->with('MyExtension');
145  $this->requestBuilder->build();
146  }
147 
151  public function ‪buildSetsRequestControllerName(): void
152  {
153  $this->‪injectDependencies();
154  $this->mockRequest->expects($this->once())->method('setControllerName')->with('TheFirstController');
155  $this->requestBuilder->build();
156  }
157 
161  public function ‪buildSetsRequestControllerActionName(): void
162  {
163  $this->‪injectDependencies();
164  $this->mockRequest->expects($this->once())->method('setControllerActionName')->with('show');
165  $this->requestBuilder->build();
166  }
167 
171  public function ‪buildSetsRequestRequestUri(): void
172  {
173  $this->‪injectDependencies();
174  $expectedRequestUri = \TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('TYPO3_REQUEST_URL');
175  $this->mockRequest->expects($this->once())->method('setRequestUri')->with($expectedRequestUri);
176  $this->requestBuilder->build();
177  }
178 
182  public function ‪buildSetsRequestBaseUri(): void
183  {
184  $this->‪injectDependencies();
185  $expectedBaseUri = \TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('TYPO3_SITE_URL');
186  $this->mockRequest->expects($this->once())->method('setBaseUri')->with($expectedBaseUri);
187  $this->requestBuilder->build();
188  }
189 
193  public function ‪buildSetsRequestMethod(): void
194  {
195  $this->‪injectDependencies();
196  $expectedMethod = 'SomeRequestMethod';
197  ‪$mockEnvironmentService = $this->getMockBuilder(EnvironmentService::class)
198  ->setMethods(['getServerRequestMethod'])
199  ->getMock();
200  ‪$mockEnvironmentService->expects($this->once())->method('getServerRequestMethod')->will($this->returnValue($expectedMethod));
201  $this->requestBuilder->_set('environmentService', ‪$mockEnvironmentService);
202  $this->mockRequest->expects($this->once())->method('setMethod')->with($expectedMethod);
203  $this->requestBuilder->build();
204  }
205 
209  public function ‪buildSetsVendorNameIfConfigured(): void
210  {
211  $this->‪injectDependencies();
212  $expectedVendor = 'Vendor';
213  $this->configuration['vendorName'] = $expectedVendor;
214  ‪$mockConfigurationManager = $this->createMock(ConfigurationManagerInterface::class);
215  ‪$mockConfigurationManager->expects($this->any())->method('getConfiguration')->will($this->returnValue($this->configuration));
216  $this->requestBuilder->_set('configurationManager', ‪$mockConfigurationManager);
217  $this->requestBuilder->_set('extensionService', $this->mockExtensionService);
218  $this->mockRequest->expects($this->once())->method('setControllerVendorName')->with($expectedVendor);
219  $this->requestBuilder->build();
220  }
221 
226  {
227  $this->‪injectDependencies();
228  $expectedVendor = 'Vendor';
229  $this->configuration['vendorName'] = $expectedVendor;
230 
231  ‪$mockConfigurationManager = $this->createMock(ConfigurationManagerInterface::class);
232  ‪$mockConfigurationManager->expects($this->any())->method('getConfiguration')->will($this->returnValue($this->configuration));
233  $this->requestBuilder->_set('configurationManager', ‪$mockConfigurationManager);
234  $this->mockRequest->expects($this->once())->method('setControllerVendorName')->with($expectedVendor);
235 
236  $this->requestBuilder->build();
237 
238  unset($this->configuration['vendorName']);
239  ‪$mockConfigurationManager = $this->createMock(ConfigurationManagerInterface::class);
240  ‪$mockConfigurationManager->expects($this->any())->method('getConfiguration')->will($this->returnValue($this->configuration));
241  $this->requestBuilder->_set('configurationManager', ‪$mockConfigurationManager);
242 
243  $this->mockRequest->expects($this->never())->method('setControllerVendorName');
244  $this->requestBuilder->build();
245  }
246 
251  {
252  $this->expectException(Exception::class);
253  $this->expectExceptionCode(1289843275);
254  unset($this->configuration['extensionName']);
255  ‪$mockConfigurationManager = $this->createMock(ConfigurationManagerInterface::class);
256  ‪$mockConfigurationManager->expects($this->any())->method('getConfiguration')->will($this->returnValue($this->configuration));
257  $this->requestBuilder->_set('configurationManager', ‪$mockConfigurationManager);
258  $this->requestBuilder->build();
259  }
260 
265  {
266  $this->expectException(Exception::class);
267  $this->expectExceptionCode(1289843277);
268  unset($this->configuration['pluginName']);
269  ‪$mockConfigurationManager = $this->createMock(ConfigurationManagerInterface::class);
270  ‪$mockConfigurationManager->expects($this->any())->method('getConfiguration')->will($this->returnValue($this->configuration));
271  $this->requestBuilder->_set('configurationManager', ‪$mockConfigurationManager);
272  $this->requestBuilder->_set('extensionService', $this->mockExtensionService);
273  $this->requestBuilder->build();
274  }
275 
280  {
281  $this->expectException(Exception::class);
282  $this->expectExceptionCode(1316104317);
283  $this->configuration['controllerConfiguration'] = [];
284  $this->mockConfigurationManager->expects($this->any())->method('getConfiguration')->will($this->returnValue($this->configuration));
285  $this->requestBuilder->_set('configurationManager', $this->mockConfigurationManager);
286  $this->requestBuilder->_set('extensionService', $this->mockExtensionService);
287  $this->requestBuilder->build();
288  }
289 
294  {
295  $this->expectException(Exception::class);
296  $this->expectExceptionCode(1295479651);
297  $this->configuration['controllerConfiguration']['TheFirstController'] = [];
298  $this->mockConfigurationManager->expects($this->any())->method('getConfiguration')->will($this->returnValue($this->configuration));
299  $this->requestBuilder->_set('configurationManager', $this->mockConfigurationManager);
300  $this->requestBuilder->_set('extensionService', $this->mockExtensionService);
301  $this->requestBuilder->build();
302  }
303 
308  {
309  $this->expectException(Exception::class);
310  $this->expectExceptionCode(1316104317);
311  $this->configuration['controllerConfiguration'] = [
312  '' => [
313  'actions' => ['foo']
314  ]
315  ];
316  $this->mockConfigurationManager->expects($this->any())->method('getConfiguration')->will($this->returnValue($this->configuration));
317  $this->requestBuilder->_set('configurationManager', $this->mockConfigurationManager);
318  $this->requestBuilder->_set('extensionService', $this->mockExtensionService);
319  $this->requestBuilder->build();
320  }
321 
325  public function ‪buildSetsParametersFromGetAndPostVariables(): void
326  {
327  $this->configuration['extensionName'] = 'SomeExtensionName';
328  $this->configuration['pluginName'] = 'SomePluginName';
329  $this->‪injectDependencies();
330  $_GET = [
331  'tx_someotherextensionname_somepluginname' => [
332  'foo' => 'bar'
333  ],
334  'tx_someextensionname_somepluginname' => [
335  'parameter1' => 'valueGetsOverwritten',
336  'parameter2' => [
337  'parameter3' => 'value3'
338  ]
339  ]
340  ];
341  $_POST = [
342  'tx_someextensionname_someotherpluginname' => [
343  'foo' => 'bar'
344  ],
345  'tx_someextensionname_somepluginname' => [
346  'parameter1' => 'value1',
347  'parameter2' => [
348  'parameter4' => 'value4'
349  ]
350  ]
351  ];
352  $this->mockRequest->expects($this->at(8))->method('setArgument')->with('parameter1', 'value1');
353  $this->mockRequest->expects($this->at(9))->method('setArgument')->with(
354  'parameter2',
355  ['parameter3' => 'value3', 'parameter4' => 'value4']
356  );
357  $this->requestBuilder->build();
358  }
359 
363  public function ‪buildSetsFormatFromGetAndPostVariables(): void
364  {
365  $this->configuration['extensionName'] = 'SomeExtensionName';
366  $this->configuration['pluginName'] = 'SomePluginName';
367  $this->‪injectDependencies();
368  $_GET = [
369  'tx_someextensionname_somepluginname' => [
370  'format' => 'GET'
371  ]
372  ];
373  $_POST = [
374  'tx_someextensionname_somepluginname' => [
375  'format' => 'POST'
376  ]
377  ];
378  $this->mockRequest->expects($this->at(7))->method('setFormat')->with('POST');
379  $this->requestBuilder->build();
380  }
381 
385  public function ‪buildCorrectlySetsAllowedControllerActions(): void
386  {
387  $this->‪injectDependencies();
388  $expectedResult = [
389  'TheFirstController' => [
390  'show',
391  'index',
392  'new',
393  'create',
394  'delete',
395  'edit',
396  'update',
397  'setup',
398  'test'
399  ],
400  'TheSecondController' => [
401  'show',
402  'index'
403  ],
404  'TheThirdController' => [
405  'delete',
406  'create',
407  'onlyInThirdController'
408  ]
409  ];
410  $this->requestBuilder->build();
411  $actualResult = $this->requestBuilder->_get('allowedControllerActions');
412  $this->assertEquals($expectedResult, $actualResult);
413  }
414 
419  {
420  $this->expectException(Exception::class);
421  $this->expectExceptionCode(1316104317);
422  $this->configuration['controllerConfiguration'] = [];
423  $this->mockConfigurationManager->expects($this->any())->method('getConfiguration')->will($this->returnValue($this->configuration));
424  $this->requestBuilder->_set('configurationManager', $this->mockConfigurationManager);
425  $this->mockExtensionService->expects($this->any())->method('getPluginNamespace')->will($this->returnValue('tx_myextension_pi1'));
426  $this->requestBuilder->_set('extensionService', $this->mockExtensionService);
427  $this->requestBuilder->build();
428  }
429 
434  {
435  $this->‪injectDependencies();
436  $_GET = [
437  'tx_myextension_pi1' => [
438  'foo' => 'bar'
439  ]
440  ];
441  $this->mockRequest->expects($this->once())->method('setControllerName')->with('TheFirstController');
442  $this->requestBuilder->build();
443  }
444 
449  {
450  $this->‪injectDependencies();
451  $_GET = [
452  'tx_myextension_pi1' => [
453  'controller' => 'TheSecondController'
454  ]
455  ];
456  $this->mockRequest->expects($this->once())->method('setControllerName')->with('TheSecondController');
457  $this->requestBuilder->build();
458  }
459 
464  {
465  $this->expectException(InvalidControllerNameException::class);
466  $this->expectExceptionCode(1313855173);
467  $this->mockConfigurationManager->expects($this->any())->method('getConfiguration')->will($this->returnValue($this->configuration));
468  $this->requestBuilder->_set('configurationManager', $this->mockConfigurationManager);
469  $this->mockExtensionService->expects($this->any())->method('getPluginNamespace')->will($this->returnValue('tx_myextension_pi1'));
470  $this->requestBuilder->_set('extensionService', $this->mockExtensionService);
471  $_GET = [
472  'tx_myextension_pi1' => [
473  'controller' => 'SomeInvalidController'
474  ]
475  ];
476  $this->requestBuilder->build();
477  }
478 
483  {
484  $this->expectException(PageNotFoundException::class);
485  $this->expectExceptionCode(1313857897);
486  $this->configuration['mvc']['throwPageNotFoundExceptionIfActionCantBeResolved'] = 1;
487  $this->mockConfigurationManager->expects($this->any())->method('getConfiguration')->will($this->returnValue($this->configuration));
488  $this->requestBuilder->_set('configurationManager', $this->mockConfigurationManager);
489  $this->mockExtensionService->expects($this->any())->method('getPluginNamespace')->will($this->returnValue('tx_myextension_pi1'));
490  $this->requestBuilder->_set('extensionService', $this->mockExtensionService);
491  $_GET = [
492  'tx_myextension_pi1' => [
493  'controller' => 'SomeInvalidController'
494  ]
495  ];
496  $this->requestBuilder->build();
497  }
498 
503  {
504  $this->configuration['mvc']['callDefaultActionIfActionCantBeResolved'] = 1;
505  $this->‪injectDependencies();
506  $this->requestBuilder->_set('extensionService', $this->mockExtensionService);
507  $_GET = [
508  'tx_myextension_pi1' => [
509  'controller' => 'SomeInvalidController'
510  ]
511  ];
512  $this->mockRequest->expects($this->once())->method('setControllerName')->with('TheFirstController');
513  $this->requestBuilder->build();
514  }
515 
520  {
521  $this->expectException(Exception::class);
522  $this->expectExceptionCode(1316104317);
523  $this->configuration['controllerConfiguration'] = [];
524  $this->mockConfigurationManager->expects($this->any())->method('getConfiguration')->will($this->returnValue($this->configuration));
525  $this->requestBuilder->_set('configurationManager', $this->mockConfigurationManager);
526  $this->mockExtensionService->expects($this->any())->method('getPluginNamespace')->will($this->returnValue('tx_myextension_pi1'));
527  $this->requestBuilder->_set('extensionService', $this->mockExtensionService);
528  $this->requestBuilder->build();
529  }
530 
535  {
536  $this->‪injectDependencies();
537  $_GET = [
538  'tx_myextension_pi1' => [
539  'controller' => 'TheThirdController'
540  ]
541  ];
542  $this->mockRequest->expects($this->once())->method('setControllerActionName')->with('delete');
543  $this->requestBuilder->build();
544  }
545 
550  {
551  $this->‪injectDependencies();
552  $_GET = [
553  'tx_myextension_pi1' => [
554  'action' => 'create'
555  ]
556  ];
557  $this->mockRequest->expects($this->once())->method('setControllerActionName')->with('create');
558  $this->requestBuilder->build();
559  }
560 
565  {
566  $this->‪injectDependencies();
567  $_GET = [
568  'tx_myextension_pi1' => [
569  'controller' => 'TheThirdController',
570  'action' => 'onlyInThirdController'
571  ]
572  ];
573  $this->mockRequest->expects($this->once())->method('setControllerActionName')->with('onlyInThirdController');
574  $this->requestBuilder->build();
575  }
576 
581  {
582  $this->expectException(InvalidActionNameException::class);
583  $this->expectExceptionCode(1313855175);
584  $this->mockConfigurationManager->expects($this->any())->method('getConfiguration')->will($this->returnValue($this->configuration));
585  $this->requestBuilder->_set('configurationManager', $this->mockConfigurationManager);
586  $this->mockExtensionService->expects($this->any())->method('getPluginNamespace')->will($this->returnValue('tx_myextension_pi1'));
587  $this->requestBuilder->_set('extensionService', $this->mockExtensionService);
588  $_GET = [
589  'tx_myextension_pi1' => [
590  'action' => 'someInvalidAction'
591  ]
592  ];
593  $this->requestBuilder->build();
594  }
595 
600  {
601  $this->expectException(PageNotFoundException::class);
602  $this->expectExceptionCode(1313857898);
603  $this->configuration['mvc']['throwPageNotFoundExceptionIfActionCantBeResolved'] = 1;
604  $this->mockConfigurationManager->expects($this->any())->method('getConfiguration')->will($this->returnValue($this->configuration));
605  $this->requestBuilder->_set('configurationManager', $this->mockConfigurationManager);
606  $this->mockExtensionService->expects($this->any())->method('getPluginNamespace')->will($this->returnValue('tx_myextension_pi1'));
607  $this->requestBuilder->_set('extensionService', $this->mockExtensionService);
608  $_GET = [
609  'tx_myextension_pi1' => [
610  'action' => 'someInvalidAction'
611  ]
612  ];
613  $this->requestBuilder->build();
614  }
615 
620  {
621  $this->configuration['mvc']['callDefaultActionIfActionCantBeResolved'] = 1;
622  $this->‪injectDependencies();
623  $this->requestBuilder->_set('extensionService', $this->mockExtensionService);
624  $_GET = [
625  'tx_myextension_pi1' => [
626  'controller' => 'TheThirdController',
627  'action' => 'someInvalidAction'
628  ]
629  ];
630  $this->mockRequest->expects($this->once())->method('setControllerName')->with('TheThirdController');
631  $this->mockRequest->expects($this->once())->method('setControllerActionName')->with('delete');
632  $this->requestBuilder->build();
633  }
634 
640  {
641  $convolutedFiles = [
642  'a0' => [
643  'name' => [
644  'a1' => 'a.txt'
645  ],
646  'type' => [
647  'a1' => 'text/plain'
648  ],
649  'tmp_name' => [
650  'a1' => '/private/var/tmp/phpbqXsYt'
651  ],
652  'error' => [
653  'a1' => 0
654  ],
655  'size' => [
656  'a1' => 100
657  ]
658  ],
659  'b0' => [
660  'name' => [
661  'b1' => 'b.txt'
662  ],
663  'type' => [
664  'b1' => 'text/plain'
665  ],
666  'tmp_name' => [
667  'b1' => '/private/var/tmp/phpvZ6oUD'
668  ],
669  'error' => [
670  'b1' => 0
671  ],
672  'size' => [
673  'b1' => 200
674  ]
675  ],
676  'c' => [
677  'name' => 'c.txt',
678  'type' => 'text/plain',
679  'tmp_name' => '/private/var/tmp/phpS9KMNw',
680  'error' => 0,
681  'size' => 300
682  ],
683  'd0' => [
684  'name' => [
685  'd1' => [
686  0 => 'd12.txt',
687  'd2' => [
688  'd3' => 'd.txt'
689  ]
690  ]
691  ],
692  'type' => [
693  'd1' => [
694  0 => 'text/plain',
695  'd2' => [
696  'd3' => 'text/plain'
697  ]
698  ]
699  ],
700  'tmp_name' => [
701  'd1' => [
702  0 => '/private/var/tmp/phpMf9Qx9',
703  'd2' => [
704  'd3' => '/private/var/tmp/phprR3fax'
705  ]
706  ]
707  ],
708  'error' => [
709  'd1' => [
710  0 => 0,
711  'd2' => [
712  'd3' => 0
713  ]
714  ]
715  ],
716  'size' => [
717  'd1' => [
718  0 => 200,
719  'd2' => [
720  'd3' => 400
721  ]
722  ]
723  ]
724  ],
725  'e0' => [
726  'name' => [
727  'e1' => [
728  'e2' => [
729  0 => 'e_one.txt',
730  1 => 'e_two.txt'
731  ]
732  ]
733  ],
734  'type' => [
735  'e1' => [
736  'e2' => [
737  0 => 'text/plain',
738  1 => 'text/plain'
739  ]
740  ]
741  ],
742  'tmp_name' => [
743  'e1' => [
744  'e2' => [
745  0 => '/private/var/tmp/php01fitB',
746  1 => '/private/var/tmp/phpUUB2cv'
747  ]
748  ]
749  ],
750  'error' => [
751  'e1' => [
752  'e2' => [
753  0 => 0,
754  1 => 0
755  ]
756  ]
757  ],
758  'size' => [
759  'e1' => [
760  'e2' => [
761  0 => 510,
762  1 => 520
763  ]
764  ]
765  ]
766  ],
767  'error' => [
768  'name' => 'error_file.txt',
769  'type' => 'text/plain',
770  'tmp_name' => '/private/var/tmp/phpADDu87fE',
771  'error' => 0,
772  'size' => 120
773  ]
774  ];
775  $untangledFiles = [
776  'a0' => [
777  'a1' => [
778  'name' => 'a.txt',
779  'type' => 'text/plain',
780  'tmp_name' => '/private/var/tmp/phpbqXsYt',
781  'error' => 0,
782  'size' => 100
783  ]
784  ],
785  'b0' => [
786  'b1' => [
787  'name' => 'b.txt',
788  'type' => 'text/plain',
789  'tmp_name' => '/private/var/tmp/phpvZ6oUD',
790  'error' => 0,
791  'size' => 200
792  ]
793  ],
794  'c' => [
795  'name' => 'c.txt',
796  'type' => 'text/plain',
797  'tmp_name' => '/private/var/tmp/phpS9KMNw',
798  'error' => 0,
799  'size' => 300
800  ],
801  'd0' => [
802  'd1' => [
803  0 => [
804  'name' => 'd12.txt',
805  'type' => 'text/plain',
806  'tmp_name' => '/private/var/tmp/phpMf9Qx9',
807  'error' => 0,
808  'size' => 200
809  ],
810  'd2' => [
811  'd3' => [
812  'name' => 'd.txt',
813  'type' => 'text/plain',
814  'tmp_name' => '/private/var/tmp/phprR3fax',
815  'error' => 0,
816  'size' => 400
817  ]
818  ]
819  ]
820  ],
821  'e0' => [
822  'e1' => [
823  'e2' => [
824  0 => [
825  'name' => 'e_one.txt',
826  'type' => 'text/plain',
827  'tmp_name' => '/private/var/tmp/php01fitB',
828  'error' => 0,
829  'size' => 510
830  ],
831  1 => [
832  'name' => 'e_two.txt',
833  'type' => 'text/plain',
834  'tmp_name' => '/private/var/tmp/phpUUB2cv',
835  'error' => 0,
836  'size' => 520
837  ]
838  ]
839  ]
840  ],
841  'error' => [
842  'name' => 'error_file.txt',
843  'type' => 'text/plain',
844  'tmp_name' => '/private/var/tmp/phpADDu87fE',
845  'error' => 0,
846  'size' => 120
847  ]
848  ];
849  ‪$requestBuilder = $this->getAccessibleMock(RequestBuilder::class, ['dummy'], [], '', false);
850  $result = ‪$requestBuilder->_call('untangleFilesArray', $convolutedFiles);
851  $this->assertSame($untangledFiles, $result);
852  }
853 }
‪TYPO3\CMS\Extbase\Tests\Unit\Mvc\Web\RequestBuilderTest\buildThrowsInvalidActionNameExceptionIfSpecifiedActionIsNotAllowed
‪buildThrowsInvalidActionNameExceptionIfSpecifiedActionIsNotAllowed()
Definition: RequestBuilderTest.php:573
‪TYPO3\CMS\Extbase\Tests\Unit\Mvc\Web\RequestBuilderTest\buildSetsRequestMethod
‪buildSetsRequestMethod()
Definition: RequestBuilderTest.php:186
‪TYPO3\CMS\Extbase\Tests\Unit\Mvc\Web\RequestBuilderTest\buildThrowsExceptionIfControllerConfigurationIsEmptyOrNotSet
‪buildThrowsExceptionIfControllerConfigurationIsEmptyOrNotSet()
Definition: RequestBuilderTest.php:272
‪TYPO3\CMS\Extbase\Tests\Unit\Mvc\Web\RequestBuilderTest\buildSetsDefaultControllerIfNoControllerIsSpecified
‪buildSetsDefaultControllerIfNoControllerIsSpecified()
Definition: RequestBuilderTest.php:426
‪TYPO3\CMS\Extbase\Tests\Unit\Mvc\Web\RequestBuilderTest\$mockConfigurationManager
‪ConfigurationManagerInterface PHPUnit_Framework_MockObject_MockObject $mockConfigurationManager
Definition: RequestBuilderTest.php:41
‪TYPO3\CMS\Extbase\Tests\Unit\Mvc\Web\RequestBuilderTest\buildSetsParametersFromGetAndPostVariables
‪buildSetsParametersFromGetAndPostVariables()
Definition: RequestBuilderTest.php:318
‪TYPO3\CMS\Extbase\Mvc\Exception\InvalidControllerNameException
Definition: InvalidControllerNameException.php:21
‪TYPO3\CMS\Extbase\Tests\Unit\Mvc\Web\RequestBuilderTest\buildThrowsExceptionIfControllerConfigurationHasNoDefaultActionDefined
‪buildThrowsExceptionIfControllerConfigurationHasNoDefaultActionDefined()
Definition: RequestBuilderTest.php:286
‪TYPO3\CMS\Extbase\Tests\Unit\Mvc\Web\RequestBuilderTest\$configuration
‪array $configuration
Definition: RequestBuilderTest.php:45
‪TYPO3\CMS\Extbase\Tests\Unit\Mvc\Web\RequestBuilderTest\buildThrowsExceptionIfDefaultControllerCantBeDetermined
‪buildThrowsExceptionIfDefaultControllerCantBeDetermined()
Definition: RequestBuilderTest.php:411
‪TYPO3\CMS\Extbase\Tests\Unit\Mvc\Web\RequestBuilderTest\$mockExtensionService
‪ExtensionService PHPUnit_Framework_MockObject_MockObject $mockExtensionService
Definition: RequestBuilderTest.php:53
‪TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface
Definition: ConfigurationManagerInterface.php:22
‪TYPO3\CMS\Extbase\Tests\Unit\Mvc\Web\RequestBuilderTest\buildThrowsInvalidControllerNameExceptionIfSpecifiedControllerIsNotAllowed
‪buildThrowsInvalidControllerNameExceptionIfSpecifiedControllerIsNotAllowed()
Definition: RequestBuilderTest.php:456
‪TYPO3\CMS\Extbase\Tests\Unit\Mvc\Web\RequestBuilderTest\injectDependencies
‪injectDependencies()
Definition: RequestBuilderTest.php:98
‪TYPO3\CMS\Extbase\Tests\Unit\Mvc\Web\RequestBuilderTest\buildThrowsExceptionIfPluginNameIsNotConfigured
‪buildThrowsExceptionIfPluginNameIsNotConfigured()
Definition: RequestBuilderTest.php:257
‪TYPO3\CMS\Extbase\Tests\Unit\Mvc\Web\RequestBuilderTest\buildThrowsExceptionIfNoDefaultControllerCanBeResolved
‪buildThrowsExceptionIfNoDefaultControllerCanBeResolved()
Definition: RequestBuilderTest.php:300
‪TYPO3\CMS\Extbase\Tests\Unit\Mvc\Web\RequestBuilderTest\$requestBuilder
‪RequestBuilder PHPUnit_Framework_MockObject_MockObject TYPO3 TestingFramework Core AccessibleObjectInterface $requestBuilder
Definition: RequestBuilderTest.php:37
‪TYPO3\CMS\Extbase\Tests\Unit\Mvc\Web\RequestBuilderTest\buildThrowsExceptionIfDefaultActionCantBeDetermined
‪buildThrowsExceptionIfDefaultActionCantBeDetermined()
Definition: RequestBuilderTest.php:512
‪TYPO3\CMS\Extbase\Object\ObjectManagerInterface
Definition: ObjectManagerInterface.php:23
‪TYPO3\CMS\Extbase\Tests\Unit\Mvc\Web\RequestBuilderTest\buildCorrectlySetsAllowedControllerActions
‪buildCorrectlySetsAllowedControllerActions()
Definition: RequestBuilderTest.php:378
‪TYPO3\CMS\Extbase\Tests\Unit\Mvc\Web\RequestBuilderTest\$mockRequest
‪Request PHPUnit_Framework_MockObject_MockObject $mockRequest
Definition: RequestBuilderTest.php:61
‪TYPO3\CMS\Extbase\Tests\Unit\Mvc\Web\RequestBuilderTest\setUp
‪setUp()
Definition: RequestBuilderTest.php:66
‪TYPO3\CMS\Extbase\Tests\Unit\Mvc\Web\RequestBuilderTest\buildSetsDefaultActionOfTheCurrentControllerIfNoActionIsSpecified
‪buildSetsDefaultActionOfTheCurrentControllerIfNoActionIsSpecified()
Definition: RequestBuilderTest.php:527
‪TYPO3\CMS\Extbase\Tests\Unit\Mvc\Web\RequestBuilderTest\buildCorrectlySetsSpecifiedActionNameForTheSpecifiedControllerIfItsAllowedForTheCurrentPlugin
‪buildCorrectlySetsSpecifiedActionNameForTheSpecifiedControllerIfItsAllowedForTheCurrentPlugin()
Definition: RequestBuilderTest.php:557
‪TYPO3\CMS\Core\Error\Http\PageNotFoundException
Definition: PageNotFoundException.php:21
‪TYPO3\CMS\Extbase\Tests\Unit\Mvc\Web\RequestBuilderTest\buildSetsDefaultActionNameIfSpecifiedActionIsNotAllowedAndCallDefaultActionIfActionCantBeResolvedIsSet
‪buildSetsDefaultActionNameIfSpecifiedActionIsNotAllowedAndCallDefaultActionIfActionCantBeResolvedIsSet()
Definition: RequestBuilderTest.php:612
‪TYPO3\CMS\Extbase\Tests\Unit\Mvc\Web\RequestBuilderTest\buildSetsFormatFromGetAndPostVariables
‪buildSetsFormatFromGetAndPostVariables()
Definition: RequestBuilderTest.php:356
‪TYPO3\CMS\Extbase\Tests\Unit\Mvc\Web\RequestBuilderTest\buildSetsRequestControllerActionName
‪buildSetsRequestControllerActionName()
Definition: RequestBuilderTest.php:154
‪TYPO3\CMS\Extbase\Tests\Unit\Mvc\Web\RequestBuilderTest\buildSetsRequestControllerExtensionName
‪buildSetsRequestControllerExtensionName()
Definition: RequestBuilderTest.php:134
‪TYPO3\CMS\Extbase\Tests\Unit\Mvc\Web\RequestBuilderTest\buildThrowsPageNotFoundExceptionIfEnabledAndSpecifiedControllerIsNotAllowed
‪buildThrowsPageNotFoundExceptionIfEnabledAndSpecifiedControllerIsNotAllowed()
Definition: RequestBuilderTest.php:475
‪TYPO3\CMS\Extbase\Tests\Unit\Mvc\Web\RequestBuilderTest\buildCorrectlySetsSpecifiedActionNameForTheDefaultControllerIfItsAllowedForTheCurrentPlugin
‪buildCorrectlySetsSpecifiedActionNameForTheDefaultControllerIfItsAllowedForTheCurrentPlugin()
Definition: RequestBuilderTest.php:542
‪TYPO3\CMS\Extbase\Mvc\Exception
Definition: AmbiguousCommandIdentifierException.php:2
‪TYPO3\CMS\Extbase\Tests\Unit\Mvc\Web\RequestBuilderTest\buildCorrectlySetsSpecifiedControllerNameIfItsAllowedForTheCurrentPlugin
‪buildCorrectlySetsSpecifiedControllerNameIfItsAllowedForTheCurrentPlugin()
Definition: RequestBuilderTest.php:441
‪TYPO3\CMS\Extbase\Mvc\Web\Request
Definition: Request.php:21
‪TYPO3\CMS\Extbase\Tests\Unit\Mvc\Web\RequestBuilderTest\buildSetsVendorNameIfConfigured
‪buildSetsVendorNameIfConfigured()
Definition: RequestBuilderTest.php:202
‪TYPO3\CMS\Extbase\Tests\Unit\Mvc\Web\RequestBuilderTest\buildReturnsAWebRequestObject
‪buildReturnsAWebRequestObject()
Definition: RequestBuilderTest.php:114
‪TYPO3\CMS\Extbase\Service\EnvironmentService
Definition: EnvironmentService.php:24
‪TYPO3\CMS\Extbase\Tests\Unit\Mvc\Web\RequestBuilderTest\$mockEnvironmentService
‪EnvironmentService PHPUnit_Framework_MockObject_MockObject $mockEnvironmentService
Definition: RequestBuilderTest.php:57
‪TYPO3\CMS\Extbase\Tests\Unit\Mvc\Web\RequestBuilderTest\buildSetsRequestBaseUri
‪buildSetsRequestBaseUri()
Definition: RequestBuilderTest.php:175
‪TYPO3\CMS\Extbase\Tests\Unit\Mvc\Web
Definition: CacheHashEnforcerTest.php:3
‪TYPO3\CMS\Extbase\Tests\Unit\Mvc\Web\RequestBuilderTest\buildSetsRequestControllerName
‪buildSetsRequestControllerName()
Definition: RequestBuilderTest.php:144
‪TYPO3\CMS\Extbase\Service\ExtensionService
Definition: ExtensionService.php:29
‪TYPO3\CMS\Extbase\Mvc\Exception\InvalidActionNameException
Definition: InvalidActionNameException.php:21
‪TYPO3\CMS\Extbase\Tests\Unit\Mvc\Web\RequestBuilderTest
Definition: RequestBuilderTest.php:34
‪TYPO3\CMS\Extbase\Tests\Unit\Mvc\Web\RequestBuilderTest\buildSetsRequestPluginName
‪buildSetsRequestPluginName()
Definition: RequestBuilderTest.php:124
‪TYPO3\CMS\Extbase\Tests\Unit\Mvc\Web\RequestBuilderTest\buildSetsDefaultControllerNameIfSpecifiedControllerIsNotAllowedAndCallDefaultActionIfActionCantBeResolvedIsSet
‪buildSetsDefaultControllerNameIfSpecifiedControllerIsNotAllowedAndCallDefaultActionIfActionCantBeResolvedIsSet()
Definition: RequestBuilderTest.php:495
‪TYPO3\CMS\Extbase\Tests\Unit\Mvc\Web\RequestBuilderTest\$mockObjectManager
‪ObjectManagerInterface PHPUnit_Framework_MockObject_MockObject $mockObjectManager
Definition: RequestBuilderTest.php:49
‪TYPO3\CMS\Extbase\Tests\Unit\Mvc\Web\RequestBuilderTest\buildSetsRequestRequestUri
‪buildSetsRequestRequestUri()
Definition: RequestBuilderTest.php:164
‪TYPO3\CMS\Extbase\Tests\Unit\Mvc\Web\RequestBuilderTest\buildThrowsExceptionIfExtensionNameIsNotConfigured
‪buildThrowsExceptionIfExtensionNameIsNotConfigured()
Definition: RequestBuilderTest.php:243
‪TYPO3\CMS\Extbase\Tests\Unit\Mvc\Web\RequestBuilderTest\buildDoesNotSetVendorNameIfNotConfiguredInSecondRequest
‪buildDoesNotSetVendorNameIfNotConfiguredInSecondRequest()
Definition: RequestBuilderTest.php:218
‪TYPO3\CMS\Extbase\Mvc\Web\RequestBuilder
Definition: RequestBuilder.php:29
‪TYPO3\CMS\Extbase\Tests\Unit\Mvc\Web\RequestBuilderTest\untangleFilesArrayTransformsTheFilesSuperglobalIntoAManageableForm
‪untangleFilesArrayTransformsTheFilesSuperglobalIntoAManageableForm()
Definition: RequestBuilderTest.php:632
‪TYPO3\CMS\Extbase\Tests\Unit\Mvc\Web\RequestBuilderTest\buildThrowsPageNotFoundExceptionIfEnabledAndSpecifiedActionIsNotAllowed
‪buildThrowsPageNotFoundExceptionIfEnabledAndSpecifiedActionIsNotAllowed()
Definition: RequestBuilderTest.php:592