From 2149f4bd21299ad6da0a2477febca4569cc0618c Mon Sep 17 00:00:00 2001 From: eileen Date: Wed, 12 Apr 2017 10:31:01 +1200 Subject: [PATCH] Fix test regression by correctly setting timestamp in test method --- CRM/Core/BAO/Domain.php | 9 ++++----- CRM/Core/DAO.php | 5 ++++- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/CRM/Core/BAO/Domain.php b/CRM/Core/BAO/Domain.php index 6779ff12dc..998bb25bd3 100644 --- a/CRM/Core/BAO/Domain.php +++ b/CRM/Core/BAO/Domain.php @@ -29,8 +29,6 @@ * * @package CRM * @copyright CiviCRM LLC (c) 2004-2017 - * $Id$ - * */ /** @@ -65,9 +63,10 @@ class CRM_Core_BAO_Domain extends CRM_Core_DAO_Domain { /** * 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; @@ -75,7 +74,7 @@ class CRM_Core_BAO_Domain extends CRM_Core_DAO_Domain { $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; diff --git a/CRM/Core/DAO.php b/CRM/Core/DAO.php index 4d153fb782..95081072bf 100644 --- a/CRM/Core/DAO.php +++ b/CRM/Core/DAO.php @@ -234,7 +234,6 @@ class CRM_Core_DAO extends DB_DataObject { 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') { @@ -243,6 +242,10 @@ class CRM_Core_DAO extends DB_DataObject { } 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'; -- 2.25.1