Merge branch 4.5 into master
[civicrm-core.git] / tests / qunit / crm-api3 / test.js
index 51b0154895b3641062f4d43a87ece84c34048ff9..fdf48cd8d2198034b4bc18bc94e8525790bf45e7 100644 (file)
@@ -1,10 +1,9 @@
-
 /* ------------ Test cases ------------ */
 module('api single');
 
 asyncTest("simple api call", function() {
   CRM.api3('contact', 'get').done(function(result) {
-    equal(result.is_error, 0, 'contact get failed');
+    equal(result.is_error, 0, 'contact get');
     start();
   });
 });
@@ -17,8 +16,8 @@ asyncTest("array api calls", function() {
     ['phone', 'get', {phone: '123'}]
   ];
   CRM.api3(params).done(function(result) {
-    equal(result[0].is_error, 0, 'email get failed');
-    equal(result[1].is_error, 0, 'phone get failed');
+    equal(result[0].is_error, 0, 'email get');
+    equal(result[1].is_error, 0, 'phone get');
     start();
   });
 });
@@ -26,11 +25,13 @@ asyncTest("array api calls", function() {
 asyncTest("named api calls", function() {
   var params = {
     one: ['email', 'getoptions', {field: 'location_type_id'}],
-    two: ['phone', 'get', {field: 'phone_type_id'}]
+    two: ['phone', 'getoptions', {field: 'phone_type_id', sequential: 1}],
+    three: ['phone', 'get']
   };
   CRM.api3(params).done(function(result) {
-    ok(result.one.count > 0, 'email getoptions failed');
-    ok(result.two.count > 0, 'phone getoptions failed');
+    ok(result.one.count > 0, 'email getoptions');
+    ok(result.two.count > 0, 'phone getoptions');
+    ok(result.three.count > 0, 'phone get');
     start();
   });
 });