/var/www/vhosts/ihelp.ro/httpdocs/vendor/cakephp/cakephp/src/TestSuite
NameSizeModeActions
Constraint/-0755rm
Fixture/-0755rm
Stub/-0755rm
ConnectionHelper.php60260644editdlrm
ConsoleIntegrationTestCase.php9610644editdlrm
ConsoleIntegrationTestTrait.php1840644editdlrm
ContainerStubTrait.php1540644editdlrm
EmailTrait.php85150644editdlrm
HttpClientTrait.php1450644editdlrm
IntegrationTestCase.php13550644editdlrm
IntegrationTestTrait.php467520644editdlrm
LegacyCommandRunner.php1600644editdlrm
LegacyShellDispatcher.php1660644editdlrm
MiddlewareDispatcher.php42240644editdlrm
StringCompareTrait.php19710644editdlrm
TestCase.php380200644editdlrm
TestEmailTransport.php22670644editdlrm
TestListenerTrait.php20830644editdlrm
TestSession.php21520644editdlrm
TestSuite.php20890644editdlrm
Edit: /var/www/vhosts/ihelp.ro/httpdocs/vendor/cakephp/cakephp/src/TestSuite/MiddlewareDispatcher.php (4224B)
app = $app; } /** * Resolve the provided URL into a string. * * @param array|string $url The URL array/string to resolve. * @return string */ public function resolveUrl($url): string { // If we need to resolve a Route URL but there are no routes, load routes. if (is_array($url) && count(Router::getRouteCollection()->routes()) === 0) { return $this->resolveRoute($url); } return Router::url($url); } /** * Convert a URL array into a string URL via routing. * * @param array $url The url to resolve * @return string */ protected function resolveRoute(array $url): string { // Simulate application bootstrap and route loading. // We need both to ensure plugins are loaded. $this->app->bootstrap(); if ($this->app instanceof PluginApplicationInterface) { $this->app->pluginBootstrap(); } $builder = Router::createRouteBuilder('/'); if ($this->app instanceof RoutingApplicationInterface) { $this->app->routes($builder); } if ($this->app instanceof PluginApplicationInterface) { $this->app->pluginRoutes($builder); } $out = Router::url($url); Router::resetRoutes(); return $out; } /** * Create a PSR7 request from the request spec. * * @param array $spec The request spec. * @return \Cake\Http\ServerRequest */ protected function _createRequest(array $spec): ServerRequest { if (isset($spec['input'])) { $spec['post'] = []; $spec['environment']['CAKEPHP_INPUT'] = $spec['input']; } $environment = array_merge( array_merge($_SERVER, ['REQUEST_URI' => $spec['url']]), $spec['environment'] ); if (strpos($environment['PHP_SELF'], 'phpunit') !== false) { $environment['PHP_SELF'] = '/'; } $request = ServerRequestFactory::fromGlobals( $environment, $spec['query'], $spec['post'], $spec['cookies'], $spec['files'] ); return $request ->withAttribute('session', $spec['session']) ->withAttribute('flash', new FlashMessage($spec['session'])); } /** * Run a request and get the response. * * @param array $requestSpec The request spec to execute. * @return \Psr\Http\Message\ResponseInterface The generated response. * @throws \LogicException */ public function execute(array $requestSpec): ResponseInterface { $server = new Server($this->app); return $server->run($this->_createRequest($requestSpec)); } }