if ($targetUrl) { $requestDataBag->
set('url',
$targetUrl);
} $appExists =
$appName === self::EXISTING_APP_NAME;
if (!
$appExists) { $this->
expectException(AppByNameNotFoundException::
class);
$this->
expectExceptionMessage(\
sprintf('The provided name %s is invalid and no app could be found.',
$appName));
$this->adminExtensionApiController->
runAction($requestDataBag,
$this->context
);
return;
} if (empty($hosts)) { $this->
expectException(UnallowedHostException::
class);
} else { $this->executor->
expects(static::
once())->
method('execute'
)->
with(static::
callback(static fn (AppAction
$action) =>
$action->
getTargetUrl() ===
$targetUrl))->
willReturn(new Response());
} $response =
$this->adminExtensionApiController->
runAction($requestDataBag,
$this->context
);