From 0376409d6eb0a03b0c112659177a121495ba0c53 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Thu, 13 Jun 2013 15:49:36 -0700 Subject: [PATCH] Fix phone failure test --- tests/phpunit/api/v3/PhoneTest.php | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/tests/phpunit/api/v3/PhoneTest.php b/tests/phpunit/api/v3/PhoneTest.php index 8260cf5be2..bd3878e9f1 100644 --- a/tests/phpunit/api/v3/PhoneTest.php +++ b/tests/phpunit/api/v3/PhoneTest.php @@ -121,27 +121,18 @@ class api_v3_PhoneTest extends CiviUnitTestCase { * Test civicrm_phone_get with wrong params. */ public function testGetWrongParams() { - $params = array('contact_id' => 'abc', 'version' => $this->_apiversion, 'debug'=>1 ); - $result = civicrm_api('Phone', 'Get', $params); - $this->assertEquals(0, $result['is_error'], 'In line ' . __LINE__); - $this->assertEquals(0, $result['count'], 'In line ' . __LINE__); + $this->callAPIFailure('Phone', 'Get', array('contact_id' => 'abc')); - $params = array('location_type_id' => 'abc', 'version' => $this->_apiversion); - $result = civicrm_api('Phone', 'Get', ($params)); - $this->assertEquals(1, $result['is_error'], 'In line ' . __LINE__); + $this->callAPIFailure('Phone', 'Get', array('location_type_id' => 'abc')); - $params = array('phone_type_id' => 'abc', 'version' => $this->_apiversion); - $result = civicrm_api('Phone', 'Get', ($params)); - $this->assertEquals(1, $result['is_error'], 'In line ' . __LINE__); - $this->assertTrue(empty($result['count']), 'In line ' . __LINE__); + $this->callAPIFailure('Phone', 'Get', array('phone_type_id' => 'abc')); } /** * Test civicrm_phone_get - success expected. */ public function testGet() { - $phone = civicrm_api('phone', 'create', $this->_params); - $this->assertAPISuccess($phone, 'In line ' . __LINE__); + $phone = $this->callAPISuccess('phone', 'create', $this->_params); $params = array( 'contact_id' => $this->_params['contact_id'], 'phone' => $phone['values'][$phone['id']]['phone'], -- 2.25.1