wip: finalize implementation

This commit is contained in:
Björn Fromme
2026-03-16 11:59:11 +01:00
parent c830fc7841
commit a8cf67728b
6 changed files with 28 additions and 3 deletions
+22
View File
@@ -15,6 +15,7 @@ class AppRuntime implements RuntimeExtensionInterface
private readonly IntlExtension $intlExtension,
private readonly CountryDataProvider $countryDataProvider,
private readonly ParticipantEligibilityService $participantEligibilityService,
private readonly string $environment,
) {
}
@@ -101,4 +102,25 @@ class AppRuntime implements RuntimeExtensionInterface
{
return $this->participantEligibilityService->isParticipantEligible($bookingDto, $participantIndex);
}
/**
* Renders a QA attribute for testing purposes.
*
* @param string $label The label for the QA attribute
* @param string|null $value The value for the QA attribute
*
* @return string The rendered QA attribute
*/
public function renderQaAttribute(string $label, ?string $value = null): string
{
if ('prod' === $this->environment) {
return '';
}
if (null === $value) {
return sprintf(' data-qa-%s', strtolower($label));
}
return sprintf(' data-qa-%s="%s"', strtolower($label), $value);
}
}