Skip to content

Commit

Permalink
Merge pull request #10145 from eileenmcnaughton/test-fail
Browse files Browse the repository at this point in the history
Fix test regression by correctly setting timestamp in test method
  • Loading branch information
eileenmcnaughton authored Apr 11, 2017
2 parents e620163 + 2149f4b commit 3ea7bd0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
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

0 comments on commit 3ea7bd0

Please sign in to comment.