3 * File for the CRM11793 issue
4 * Include class definitions
8 * Test APIv3 civicrm_activity_* functions
13 class api_v3_CRM11793Test
extends CiviUnitTestCase
{
16 * Test setup for every test.
18 * Connect to the database, truncate the tables that will be used
19 * and redirect stdin to a temporary file
21 public function setUp() {
22 // Connect to the database
25 require_once 'CiviTest/Contact.php';
27 // lets create one contact of each type
28 Contact
::createIndividual();
29 Contact
::createHousehold();
30 Contact
::createOrganisation();
33 public function tearDown() {
37 * Test civicrm_contact_create.
39 * Verify that attempt to create individual contact with only
40 * first and last names succeeds
42 public function testCRM11793Organization() {
43 $this->_testCRM11793ContactType('Organization');
46 public function testCRM11793Household() {
47 $this->_testCRM11793ContactType('Household');
50 public function testCRM11793Individual() {
51 $this->_testCRM11793ContactType('Individual');
57 public function _testCRM11793ContactType($contactType) {
58 $result = $this->callAPISuccess(
62 'contact_type' => $contactType,
66 foreach ($result['values'] as $idx => $contact) {
67 $this->assertEquals($contact['contact_type'], $contactType, "In line " . __LINE__
);