From 44fef586956261bfa8a175ed9ef6958d3eade222 Mon Sep 17 00:00:00 2001 From: Matthew Grasmick Date: Thu, 23 May 2024 11:46:45 -0400 Subject: [PATCH] Updating comments. --- tests/phpunit/src/Misc/TelemetryHelperTest.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/phpunit/src/Misc/TelemetryHelperTest.php b/tests/phpunit/src/Misc/TelemetryHelperTest.php index b90ece96e..316bd40c6 100644 --- a/tests/phpunit/src/Misc/TelemetryHelperTest.php +++ b/tests/phpunit/src/Misc/TelemetryHelperTest.php @@ -75,11 +75,11 @@ public function testGetEnvironmentProviderWithoutAnyEnvSet(): void { * Test the getEnvironmentProvider method when Acquia environment is detected. */ public function testGetEnvironmentProviderWithAcquia(): void { + // We test this separately from testEnvironmentProvider() because AH_SITE_ENVIRONMENT isn't in + // TelemetryHelper::getProviders(). Instead, we rely on AcquiaDrupalEnvironmentDetector::getAhEnv() in + // getEnvironmentProvider() to indirectly tell us if AH_SITE_ENVIRONMENT is set. This allows + // AcquiaDrupalEnvironmentDetector to handle any changes to the logic of detecting Acquia environments. TestBase::setEnvVars(['AH_SITE_ENVIRONMENT' => self::ENV_VAR_DEFAULT_VALUE]); - - // We need to make sure our mocked method is used. Depending on the implementation, - // this could involve setting it statically or using dependency injection. - // Expect 'acquia' to be returned since Acquia environment is mocked to be present. $this->assertEquals('acquia', TelemetryHelper::getEnvironmentProvider()); }