Skip to content

Commit

Permalink
Fixed .phpt tests
Browse files Browse the repository at this point in the history
  • Loading branch information
SergeyKleyman committed Sep 14, 2023
1 parent 590eedd commit 47bc16a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
8 changes: 5 additions & 3 deletions agent/native/ext/tests/config_defaults.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,11 @@ elasticApmAssertSame("getenv('ELASTIC_APM_ENABLED')", getenv('ELASTIC_APM_ENABLE

elasticApmAssertEqual("ini_get('elastic_apm.enabled')", ini_get('elastic_apm.enabled'), false);

elasticApmAssertSame("elastic_apm_is_enabled()", elastic_apm_is_enabled(), true);

elasticApmAssertSame("elastic_apm_get_config_option_by_name('enabled')", elastic_apm_get_config_option_by_name('enabled'), true);
if (($agentEnabledConfigDefaultEnvVar = getenv('ELASTIC_APM_PHP_TESTS_AGENT_ENABLED_CONFIG_DEFAULT')) !== false) {
$agentEnabledConfigDefault = json_decode($agentEnabledConfigDefaultEnvVar);
elasticApmAssertSame("elastic_apm_is_enabled()", elastic_apm_is_enabled(), $agentEnabledConfigDefault);
elasticApmAssertSame("elastic_apm_get_config_option_by_name('enabled')", elastic_apm_get_config_option_by_name('enabled'), $agentEnabledConfigDefault);
}

//////////////////////////////////////////////
/////////////// log_file
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@ require __DIR__ . '/../tests_util/tests_util.php';

elasticApmAssertSame("getenv('ELASTIC_APM_ENABLED')", getenv('ELASTIC_APM_ENABLED'), 'not_valid_boolean_value');

elasticApmAssertSame("elastic_apm_is_enabled()", elastic_apm_is_enabled(), true);

elasticApmAssertSame("elastic_apm_get_config_option_by_name('enabled')", elastic_apm_get_config_option_by_name('enabled'), true);
if (($agentEnabledConfigDefaultEnvVar = getenv('ELASTIC_APM_PHP_TESTS_AGENT_ENABLED_CONFIG_DEFAULT')) !== false) {
$agentEnabledConfigDefault = json_decode($agentEnabledConfigDefaultEnvVar);
elasticApmAssertSame("elastic_apm_is_enabled()", elastic_apm_is_enabled(), $agentEnabledConfigDefault);
elasticApmAssertSame("elastic_apm_get_config_option_by_name('enabled')", elastic_apm_get_config_option_by_name('enabled'), $agentEnabledConfigDefault);
}

//////////////////////////////////////////////
/////////////// assert_level
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@ require __DIR__ . '/../tests_util/tests_util.php';

elasticApmAssertEqual("ini_get('elastic_apm.enabled')", ini_get('elastic_apm.enabled'), 'not valid boolean value');

elasticApmAssertSame("elastic_apm_get_config_option_by_name('enabled')", elastic_apm_get_config_option_by_name('enabled'), true);

elasticApmAssertSame("elastic_apm_is_enabled()", elastic_apm_is_enabled(), true);
if (($agentEnabledConfigDefaultEnvVar = getenv('ELASTIC_APM_PHP_TESTS_AGENT_ENABLED_CONFIG_DEFAULT')) !== false) {
$agentEnabledConfigDefault = json_decode($agentEnabledConfigDefaultEnvVar);
elasticApmAssertSame("elastic_apm_is_enabled()", elastic_apm_is_enabled(), $agentEnabledConfigDefault);
elasticApmAssertSame("elastic_apm_get_config_option_by_name('enabled')", elastic_apm_get_config_option_by_name('enabled'), $agentEnabledConfigDefault);
}

//////////////////////////////////////////////
/////////////// assert_level
Expand Down

0 comments on commit 47bc16a

Please sign in to comment.