Skip to content
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

Fix test regression by correctly setting timestamp in test method #10145

Merged
merged 1 commit into from
Apr 11, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions CRM/Core/BAO/Domain.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@
*
* @package CRM
* @copyright CiviCRM LLC (c) 2004-2017
* $Id$
*
*/

/**
Expand Down Expand Up @@ -65,17 +63,18 @@ public static function retrieve(&$params, &$defaults) {
/**
* Get the domain BAO.
*
* @param null $reset
* @param bool $reset
*
* @return CRM_Core_BAO_Domain|null
* @return \CRM_Core_BAO_Domain
* @throws \CRM_Core_Exception
*/
public static function getDomain($reset = NULL) {
static $domain = NULL;
if (!$domain || $reset) {
$domain = new CRM_Core_BAO_Domain();
$domain->id = CRM_Core_Config::domainID();
if (!$domain->find(TRUE)) {
CRM_Core_Error::fatal();
throw new CRM_Core_Exception('No domain in DB');
}
}
return $domain;
Expand Down
5 changes: 4 additions & 1 deletion CRM/Core/DAO.php
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,6 @@ protected function assignTestValue($fieldName, &$fieldDef, $counter) {
break;

case CRM_Utils_Type::T_DATE:
case CRM_Utils_Type::T_TIMESTAMP:
case CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME:
$this->$dbName = '19700101';
if ($dbName == 'end_date') {
Expand All @@ -243,6 +242,10 @@ protected function assignTestValue($fieldName, &$fieldDef, $counter) {
}
break;

case CRM_Utils_Type::T_TIMESTAMP:
$this->$dbName = '19700201000000';
break;

case CRM_Utils_Type::T_TIME:
CRM_Core_Error::fatal("T_TIME shouldn't be used.");
//$object->$dbName='000000';
Expand Down