Skip to content

Commit

Permalink
ACMS-3417: Add tests for getAhEnvGroup method.
Browse files Browse the repository at this point in the history
  • Loading branch information
rajeshreeputra committed Mar 13, 2024
1 parent aa8a0f1 commit aad2999
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions tests/EnvironmentDetectorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,24 @@ public function testIsAhOdeEnv($ah_site_env, $expected_env) {
*
* @dataProvider providerTestIsEnv
*/
public function testIsAcquiaLandoEnv($ah_site_env, $expected_env) {
public function testIsAcquiaLandoEnv() {
putenv("AH_SITE_ENVIRONMENT=LANDO");
$this::assertEquals('lando', AcquiaDrupalEnvironmentDetector::isAcquiaLandoEnv());
}

/**
* Tests EnvironmentDetector::isAcquiaLandoEnv().
*
* @param string $ah_site_env
* The name of the site environment.
* @param string $expected_env
* Environment type.
*
* @dataProvider providerTestIsEnv
*/
public function testGetAhEnvGroup($ah_site_env, $expected_env) {
putenv("AH_SITE_ENVIRONMENT=$ah_site_env");
$this::assertEquals($expected_env === 'lando', AcquiaDrupalEnvironmentDetector::isAcquiaLandoEnv());
$this::assertEquals($expected_env, AcquiaDrupalEnvironmentDetector::getAhEnvGroup($ah_site_env));
}

/**
Expand All @@ -105,7 +120,8 @@ public function providerTestIsEnv() {
['02live', 'prod'],
['ode1', 'ode'],
['ode2', 'ode'],
['LANDO', 'lando'],
['01update', 'other_acquia_env'],
['', 'non_acquia_env'],
];
}

Expand Down

0 comments on commit aad2999

Please sign in to comment.