Skip to content
This repository has been archived by the owner on Oct 24, 2024. It is now read-only.

Commit

Permalink
Fix phone failure test
Browse files Browse the repository at this point in the history
  • Loading branch information
colemanw committed Jun 13, 2013
1 parent a4a3348 commit 0376409
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions tests/phpunit/api/v3/PhoneTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,27 +121,18 @@ public function testGetEmptyParams() {
* 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'],
Expand Down

0 comments on commit 0376409

Please sign in to comment.