Skip to end of metadata
Go to start of metadata
  1. All the test cases will be created in civicrm/test-new/SimpleTest/api-v2/
  2. All the information needed to for test cases will be provided by common methods (civicrm/test-new/SimpleTest/Test/CiviUnitTestCase.php)
    Example: Test case for location will first need contact. So there will be one common method that will create the contact. You are only going to call that method in setUp() of your testcase file.
  3. old testcase class : class TestCreateContact extends UnitTestCase
    new testcase class : class TestCreateContact extends CiviUnitTestCase
  4. For each API, there will be separate test case file
  5. Each testcase file should contain two types of test cases
    (I) test cases that checks functionality is working as expected
    (II) test cases that checks functionality is not breaking
  6. If applicable, include custom data in most of your test cases
  7. If applicable, return parameters will be part of the params array (the keys will be prefixed by 'return.')
    Example: $params = array( 'location_name' => "Web Access", 'location_type' => "work", 'return.street_address' => 1 );
  8. Standard Data for testing.
    Previously the data being used for test cases was varying with the creators. Now we are thinking of standardizing of data.
    Example :
    Individual Data / Information :

    Field

    Value

    first_name

    Anthony

    Middle_name

    john

    Last_name

    Anderson

    prefix

    Mr.

    suffix

    Jr

    email

    anthony_anderson@civicrm.org

    Location Data / Information :

    Field

    Value

    Value

    Location type

    Home

    Work

    street address

    300 boylston AVE E

    100 main St

    city

    Seattle

    Seattle

    State/Province

    Washington

    Washington

    pin

    98102

    98104

    country

    USA

    USA

    email1

    anthony_home1@civicrm.org

    anthony_work1@civicrm.org

    email2

    anthony_home2@civicrm.org

    anthony_work2@civicrm.org

    email3

    anthony_home3@civicrm.org

    anthony_work3@civicrm.org

    phone

    71818868

    71818867

    mobile

    96768607

    967683457

    fax

    75115887

    75115807

Labels:

Creative Commons License
Except where otherwise noted, content on this site is licensed under a Creative Commons Attribution-Share Alike 3.0 United States Licence.