-
-
Notifications
You must be signed in to change notification settings - Fork 824
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CRM-18231 Environment variables #8724
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -180,4 +180,18 @@ public static function _testOnChange_onChangeExample($oldValue, $newValue, $meta | |
$_testOnChange_hookCalls['metadata'] = $metadata; | ||
} | ||
|
||
/** | ||
* Test to set isProductionEnvironment | ||
* | ||
*/ | ||
public function testSetCivicrmEnvironment() { | ||
CRM_Core_BAO_Setting::setItem('Staging', CRM_Core_BAO_Setting::DEVELOPER_PREFERENCES_NAME, 'environment'); | ||
$values = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::DEVELOPER_PREFERENCES_NAME, 'environment'); | ||
$this->assertEquals('Staging', $values); | ||
|
||
define('CIVICRM_ENVIRONMENT', 'Development'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (a) It's not safe for tests to call
(b) Does it actually help to provide special handling for this setting (
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My immediate thinking here is that what the test here is trying to prove is that if there is a value set in civicrm.settings.php that it overrides everything else. so you have a method set using essentially There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @seamuslee001 check Tim's comment about getMandatory - it makes me happy to see that |
||
$environment = CRM_Core_Config::environment(); | ||
$this->assertEquals('Development', $environment); | ||
} | ||
|
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@eileenmcnaughton reason to add this code is we cannot call
CRM_Core_Pseudoconstant::get(..)
ORbuildOptions
here as it needs DAO/BAO name to be passed either as parameter or class respectively as stated above at line 156.