Skip to content
Corex

ProviderTestService

Corex\Config\Settings\ProviderTestService · class · Config layer

Tests the Insights providers’ keys and remembers the result (spec 119, US-SET-03). The keys are read from the config engine, as Insights reads them, so a key in the site’s .env is the one tested. The captcha test is the captcha add-on’s own route; its result reaches the same log through {@see record()}.

__construct(ConfigInterface $config, ProviderSetup $setup, ProviderTestLog $log, PageSpeedKeyProbe $pageSpeed, CloudflareTokenProbe $cloudflare)

Section titled “__construct(ConfigInterface $config, ProviderSetup $setup, ProviderTestLog $log, PageSpeedKeyProbe $pageSpeed, CloudflareTokenProbe $cloudflare)”

Hears a test run by an add-on (corex_provider_tested) and answers its line (corex_provider_test_status), so corex-config never depends on the add-on.

onTested(mixed $provider, mixed $worked, mixed $reason): void

Section titled “onTested(mixed $provider, mixed $worked, mixed $reason): void”

statusFor(mixed $line, mixed $provider): string

Section titled “statusFor(mixed $line, mixed $provider): string”

Whether the provider has a key to test.

test(string $provider): ProviderTestRecord

Section titled “test(string $provider): ProviderTestRecord”

Runs the test, remembers it, and answers the line the page shows for it.

record(string $provider, bool $worked, string $reason): ProviderTestRecord

Section titled “record(string $provider, bool $worked, string $reason): ProviderTestRecord”

Remembers a test run elsewhere (the captcha add-on’s), and answers its line.

The line for the provider’s latest test of the values in force.