CRM-19123 Merging contacts: blank date fields write as 1970
[civicrm-core.git] / tests / phpunit / CRM / Contact / BAO / IndividualTest.php
CommitLineData
3cae4b8a
FV
1<?php
2
3/**
4 * Class CRM_Contact_BAO_IndividualTest
5 * @group headless
6 */
7class CRM_Contact_BAO_IndividualTest extends CiviUnitTestCase {
8
9 /**
10 * Test case for format() with "null" value dates.
11 *
12 * See CRM-19123: Merging contacts: blank date fields write as 1970
13 */
14 public function testFormatNullDates() {
15 $params = array(
16 'contact_type' => 'Individual',
17 'birth_date' => 'null',
18 'deceased_date' => 'null',
19 );
20 $contact = new CRM_Contact_DAO_Contact();
21
22 CRM_Contact_BAO_Individual::format($params, $contact);
23
24 $this->assertEmpty($contact->birth_date);
25 $this->assertEmpty($contact->deceased_date);
26 }
27}