3 * File for the CRM11793 issue
4 * Include class definitions
6 require_once 'CiviTest/CiviUnitTestCase.php';
10 * Test APIv3 civicrm_activity_* functions
14 class api_v3_CRM11793Test
extends CiviUnitTestCase
{
17 * Test setup for every test.
19 * Connect to the database, truncate the tables that will be used
20 * and redirect stdin to a temporary file
22 public function setUp() {
23 // Connect to the database
26 require_once 'CiviTest/Contact.php';
28 // lets create one contact of each type
29 Contact
::createIndividual();
30 Contact
::createHousehold();
31 Contact
::createOrganisation();
34 public function tearDown() {
38 * Test civicrm_contact_create.
40 * Verify that attempt to create individual contact with only
41 * first and last names succeeds
43 public function testCRM11793Organization() {
44 $this->_testCRM11793ContactType('Organization');
47 public function testCRM11793Household() {
48 $this->_testCRM11793ContactType('Household');
51 public function testCRM11793Individual() {
52 $this->_testCRM11793ContactType('Individual');
58 public function _testCRM11793ContactType($contactType) {
59 $result = $this->callAPISuccess(
63 'contact_type' => $contactType,
67 foreach ($result['values'] as $idx => $contact) {
68 $this->assertEquals($contact['contact_type'], $contactType, "In line " . __LINE__
);