From 8f32b0055a6f92f140f75ea68ccb20fd478f4d93 Mon Sep 17 00:00:00 2001 From: eileen Date: Tue, 27 Aug 2013 14:20:14 +1200 Subject: [PATCH] Add test for exising is_deceased behaviour on contact.get --- tests/phpunit/api/v3/ContactTest.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/phpunit/api/v3/ContactTest.php b/tests/phpunit/api/v3/ContactTest.php index b292b054fb..37017a6c62 100644 --- a/tests/phpunit/api/v3/ContactTest.php +++ b/tests/phpunit/api/v3/ContactTest.php @@ -383,6 +383,17 @@ class api_v3_ContactTest extends CiviUnitTestCase { $this->assertEquals('new employer org', $result['current_employer']); } + /** + * Check deceased contacts are not retrieved + * Note at time of writing the default is to return default. This should possibly be changed & test added + * + */ + function testGetDeceasedNotRetrieved() { + $c1 = $this->callAPISuccess($this->_entity, 'create', $this->_params); + $c2 = $this->callAPISuccess($this->_entity, 'create', array('first_name' => 'bb', 'last_name' => 'ccc', 'contact_type' => 'Individual', 'is_deceased' => 1)); + $result = $this->callAPISuccess($this->_entity, 'get', array('is_deceased' => 0)); + $this->assertFalse(array_key_exists($c2['id'], $result['values'])); + } /* * Test that sort works - old syntax -- 2.25.1