3 * File for the CRM11793 issue
4 * Include class definitions
8 * Test APIv3 civicrm_activity_* functions
12 class api_v3_CRM11793Test
extends CiviUnitTestCase
{
15 * Test setup for every test.
17 * Connect to the database, truncate the tables that will be used
18 * and redirect stdin to a temporary file
20 public function setUp() {
21 // Connect to the database
24 require_once 'CiviTest/Contact.php';
26 // lets create one contact of each type
27 Contact
::createIndividual();
28 Contact
::createHousehold();
29 Contact
::createOrganisation();
32 public function tearDown() {
36 * Test civicrm_contact_create.
38 * Verify that attempt to create individual contact with only
39 * first and last names succeeds
41 public function testCRM11793Organization() {
42 $this->_testCRM11793ContactType('Organization');
45 public function testCRM11793Household() {
46 $this->_testCRM11793ContactType('Household');
49 public function testCRM11793Individual() {
50 $this->_testCRM11793ContactType('Individual');
56 public function _testCRM11793ContactType($contactType) {
57 $result = $this->callAPISuccess(
61 'contact_type' => $contactType,
65 foreach ($result['values'] as $idx => $contact) {
66 $this->assertEquals($contact['contact_type'], $contactType, "In line " . __LINE__
);