From fd8431878836b9712234448a27a5e92f8d636436 Mon Sep 17 00:00:00 2001 From: aditya-nambiar Date: Sat, 26 Jul 2014 17:22:37 +0530 Subject: [PATCH] fixed the api and added tests --- CRM/Mailing/BAO/MailingAB.php | 2 +- api/v3/MailingAB.php | 6 +- api/v3/examples/MailingAB/Create.php | 81 ++ js/angular-crmMailingAB.js | 814 ++++++++++---------- partials/abtesting/list.html | 14 + partials/abtesting/main.html | 300 ++++---- tests/phpunit/CiviTest/CiviUnitTestCase.php | 2 +- tests/phpunit/api/v3/MailingABTest.php | 5 +- 8 files changed, 669 insertions(+), 555 deletions(-) create mode 100644 api/v3/examples/MailingAB/Create.php create mode 100644 partials/abtesting/list.html diff --git a/CRM/Mailing/BAO/MailingAB.php b/CRM/Mailing/BAO/MailingAB.php index 2df15ea1a2..6e2cc44dba 100644 --- a/CRM/Mailing/BAO/MailingAB.php +++ b/CRM/Mailing/BAO/MailingAB.php @@ -67,6 +67,7 @@ class CRM_Mailing_BAO_MailingAB extends CRM_Mailing_DAO_MailingAB { return $mailingab; } $transaction->commit(); + return $mailingab; } /** @@ -133,5 +134,4 @@ class CRM_Mailing_BAO_MailingAB extends CRM_Mailing_DAO_MailingAB { CRM_Utils_Hook::post('delete', 'MailingAB', $id, $dao); } - } diff --git a/api/v3/MailingAB.php b/api/v3/MailingAB.php index 4c295ea48f..f853209bbe 100644 --- a/api/v3/MailingAB.php +++ b/api/v3/MailingAB.php @@ -49,7 +49,7 @@ * * @return array API Success Array */ -function civicrm_api3_mailingab_create($params) { +function civicrm_api3_mailing_a_b_create($params) { return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params); } @@ -61,7 +61,7 @@ function civicrm_api3_mailingab_create($params) { * * @return array API Success Array */ -function civicrm_api3_mailingab_delete($params) { +function civicrm_api3_mailing_a_b_delete($params) { return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params); } @@ -71,7 +71,7 @@ function civicrm_api3_mailingab_delete($params) { * @param array $params * @return array */ -function civicrm_api3_mailingab_get($params) { +function civicrm_api3_mailing_a_b_get($params) { return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params); } diff --git a/api/v3/examples/MailingAB/Create.php b/api/v3/examples/MailingAB/Create.php new file mode 100644 index 0000000000..dea3cb4e34 --- /dev/null +++ b/api/v3/examples/MailingAB/Create.php @@ -0,0 +1,81 @@ + 1, + 'mailing_id_b' => 2, + 'mailing_id_c' => 3, + 'testing_criteria_id' => 1, + 'winner_criteria_id' => 1, + 'declare_winning_time' => '+2 days', + 'group_percentage' => 10, +); + +try{ + $result = civicrm_api3('mailing_a_b', 'create', $params); +} +catch (CiviCRM_API3_Exception $e) { + // handle error here + $errorMessage = $e->getMessage(); + $errorCode = $e->getErrorCode(); + $errorData = $e->getExtraParams(); + return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData); +} + +return $result; +} + +/** + * Function returns array of result expected from previous function + */ +function mailing_a_b_create_expectedresult(){ + + $expectedResult = array( + 'is_error' => 0, + 'version' => 3, + 'count' => 1, + 'id' => 1, + 'values' => array( + '1' => array( + 'id' => '1', + 'mailing_id_a' => '1', + 'mailing_id_b' => '2', + 'mailing_id_c' => '3', + 'domain_id' => '1', + 'testing_criteria_id' => '1', + 'winner_criteria_id' => '1', + 'specific_url' => '', + 'declare_winning_time' => '20140728171837', + 'group_percentage' => '10', + ), + ), +); + + return $expectedResult; +} + + +/* +* This example has been generated from the API test suite. The test that created it is called +* +* testMailingABCreateSuccess and can be found in +* https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/MailingABTest.php +* +* You can see the outcome of the API tests at +* https://test.civicrm.org/job/CiviCRM-master-git/ +* +* To Learn about the API read +* http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API +* +* Browse the api on your own site with the api explorer +* http://MYSITE.ORG/path/to/civicrm/api/explorer +* +* Read more about testing here +* http://wiki.civicrm.org/confluence/display/CRM/Testing +* +* API Standards documentation: +* http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards +*/ diff --git a/js/angular-crmMailingAB.js b/js/angular-crmMailingAB.js index bd31b0515e..5724e164ae 100644 --- a/js/angular-crmMailingAB.js +++ b/js/angular-crmMailingAB.js @@ -5,409 +5,421 @@ (function (angular, $, _) { - var partialUrl = function (relPath) { - return CRM.resourceUrls['civicrm'] + '/partials/abtesting/' + relPath; - }; - - var crmMailingAB = angular.module('crmMailingAB', ['ngRoute', 'ui.utils']); - - crmMailingAB.run(function ($rootScope, $templateCache) { - $rootScope.$on('$viewContentLoaded', function () { - $templateCache.removeAll(); - }); - }); - - crmMailingAB.config([ - '$routeProvider', - function ($routeProvider) { - $routeProvider.when('/mailing/abtesting', { - templateUrl: partialUrl('main.html'), - controller: 'TabsDemoCtrl', - resolve: { - mailingList: function ($route, crmApi) { - return crmApi('Mailing', 'get', {}); - } - } - }); - } - ]); + var partialUrl = function (relPath) { + return CRM.resourceUrls['civicrm'] + '/partials/abtesting/' + relPath; + }; + + var crmMailingAB = angular.module('crmMailingAB', ['ngRoute', 'ui.utils']); + + crmMailingAB.run(function ($rootScope, $templateCache) { + $rootScope.$on('$viewContentLoaded', function () { + $templateCache.removeAll(); + }); + }); + + crmMailingAB.config([ + '$routeProvider', + function ($routeProvider) { + $routeProvider.when('/mailing/abtesting', { + templateUrl: partialUrl('list.html'), + controller: 'ListingCtrl', + resolve: { + mailingList: function ($route, crmApi) { + return crmApi('Mailing', 'get', {}); + } + } + }); + $routeProvider.when('/mailing/abtesting/:id', { + templateUrl: partialUrl('main.html'), + controller: 'TabsDemoCtrl', + resolve: { + mailingList: function ($route, crmApi) { + return crmApi('Mailing', 'get', {}); + } + } + }); + } + ]); //----------------------------------------- - // Add a new record by name. - // Ex: - - crmMailingAB.controller('TabsDemoCtrl', function ($scope, crmApi) { - - $scope.groups = CRM.crmMailing.groupNames; - $scope.mailList = CRM.crmMailing.civiMails; - - $scope.tab_val = 0; - $scope.max_tab = 0; - $scope.campaign_clicked = function () { - if ($scope.max_tab >= 0) { - $scope.tab_val = 0; - } - }; - $scope.compose_clicked = function () { - if ($scope.max_tab >= 1) { - $scope.tab_val = 1; - } - }; - $scope.rec_clicked = function () { - if ($scope.max_tab >= 2) { - $scope.tab_val = 2; - } - }; - $scope.preview_clicked = function () { - if ($scope.max_tab >= 3) { - $scope.tab_val = 3; - } - }; - $scope.templates = - [ - { name: 'Subject Lines', url: partialUrl('subject_lines.html')}, - { name: 'From Name', url: partialUrl('from_name.html')}, - {name: 'Two different Emails', url: partialUrl('two_emails.html')} - ]; - $scope.template = $scope.templates[0]; - - $scope.slide_value = 0; - - $scope.setifyes = function (val) { - if (val == 1) { - $scope.ifyes = true; - } - else { - $scope.ifyes = false; - } - }; - - $scope.send_date = "01/01/2000"; - - $scope.dt = ""; - - $scope.mailA = {}; - - $scope.mailB = {}; - $scope.save = function (dat) { - - var result = crmApi('Mailing', 'create', dat, true); - console.log("Ac " + result); - }; - - $scope.init = function (par) { - - $scope.whatnext = par.toString() - }; - - $scope.setdate = function (par) { - console.log("called") - console.log("av " + par) - $scope.send_date = par; - $scope.dt = par; - $scope.apply(); - }; - - $scope.scheddate = {}; - $scope.scheddate.date = "6"; - $scope.scheddate.time = ""; - $scope.incGroup = []; - $scope.excGroup = []; - - - }); - - crmMailingAB.directive('nexttab', function () { - return { - // Restrict it to be an attribute in this case - restrict: 'A', - - priority: 500, - // responsible for registering DOM listeners as well as updating the DOM - link: function (scope, element, attrs) { - - $(element).parent().parent().parent().parent().tabs(scope.$eval(attrs.nexttab)); - var myarr = new Array(1, 2, 3) - $(element).parent().parent().parent().parent().tabs({disabled: myarr}); - - $(element).on("click", function () { - scope.tab_val = scope.tab_val + 1; - - scope.max_tab = Math.max(scope.tab_val, scope.max_tab); - var myArray1 = new Array(); - for (var i = scope.max_tab + 1; i < 4; i++) { - myArray1.push(i); - } - $(element).parent().parent().parent().parent().parent().tabs("option", "disabled", myArray1); - $(element).parent().parent().parent().parent().parent().tabs("option", "active", scope.tab_val); - scope.$apply(); - console.log("Adir"); - }); - } - }; - }); - - crmMailingAB.directive('prevtab', function () { - return { - // Restrict it to be an attribute in this case - restrict: 'A', - priority: 500, - // responsible for registering DOM listeners as well as updating the DOM - link: function (scope, element, attrs) { - - - $(element).on("click", function () { - var temp = scope.tab_val - 1; - scope.tab_val = scope.tab_val - 1; - - console.log(temp); - if (temp == 3) { - - } - else { - $(element).parent().parent().parent().parent().parent().tabs("option", "active", temp); - } - - scope.$apply(); - - }); - } - }; - }); - - crmMailingAB.directive('groupselect', function () { - return { - restrict: 'AE', - link: function (scope, element, attrs) { - function format(item) { - if (!item.id) { - // return `text` for optgroup - return item.text; - } - // return item template - var a = item.id.split(" "); - if (a[1] == "group" && a[2] == "include") { - return "" + " " + "" + item.text; - } - if (a[1] == "group" && a[2] == "exclude") { - return "" + " " + "" + item.text; - } - if (a[1] == "mail" && a[2] == "include") { - return "" + " " + "" + item.text; - } - if (a[1] == "mail" && a[2] == "exclude") { - return "" + " " + "" + item.text; - } - } - - $(element).select2({ - width: "400px", - placeholder: "Select the groups you wish to include", - formatResult: format, - formatSelection: format, - escapeMarkup: function (m) { - return m; - } - }); - - $(element).on('select2-selecting', function (e) { - var a = e.val.split(" "); - var l = a.length; - if (a[2] == "include") { - var str = ""; - for (i = 3; i < l; i++) { - str += a[i]; - str += " "; - } - scope.incGroup.push(str); - scope.$apply(); - } - - else { - var str = ""; - for (i = 3; i < l; i++) { - str += a[i]; - str += " "; - } - - scope.excGroup.push(str); - scope.$apply(); - } - - }); - $(element).on("select2-removed", function (e) { - if (e.val.split(" ")[2] == "exclude") { - var index = scope.excGroup.indexOf(e.val.split(" ")[3]); - scope.excGroup.splice(index, 1); - scope.$apply(); - } - else { - var index = scope.incGroup.indexOf(e.val.split(" ")[3]); - scope.incGroup.splice(index, 1); - scope.$apply(); - } - }); - } - }; - - }); - - crmMailingAB.directive('sliderbar', function () { - return{ - restrict: 'AE', - link: function (scope, element, attrs) { - $(element).slider({min: 1}); - $(element).slider({ - slide: function (event, ui) { - scope.slide_value = ui.value; - scope.$apply(); - } - }); - } - }; - }); - - crmMailingAB.directive('tpmax', function () { - return { - restrict: 'E', - link: function (scope, element, attr) { - scope.$watch('automated', function (val) { - if (val == "Yes") { - $(element).dialog({ - title: 'Automated A/B Testing', - width: 800, - height: 600, - closed: false, - cache: false, - modal: true - }); - } - }); - - $(element).find("#closebutton").on("click", function () { - $(element).dialog("close"); - }); - } - }; - }); - - crmMailingAB.directive('numbar', function () { - return{ - restrict: 'AE', - link: function (scope, element, attrs) { - $(element).spinner({max: attrs.numbar, min: 0}); - } - }; - }); - - crmMailingAB.directive('datepick', function () { - return { - - - restrict: 'AE', - link: function (scope, element, attrs) { - $(element).datepicker({ - dateFormat: "yy-mm-dd", - onSelect: function (date) { - $(".ui-datepicker a").removeAttr("href"); - - scope.scheddate.date = date.toString(); - scope.$apply(); - console.log(scope.scheddate.date); - - } - - - }); - } - }; - }); - - crmMailingAB.directive('submitform', function () { - return { - restrict: 'A', - priority: 1000, - link: function (scope, element, attrs) { - $(element).on("click", function () { - - console.log("clicked"); - scope.save({ - "sequential": 1, - "name": "Aditya Nambiar", - "subject": scope.mailA.subj, - "created_id": "2", - "from_email": scope.mailA.fromEmail, - "body_text": scope.mailA.body - - }); - console.log("Truth " + scope.whatnext) - - if (scope.whatnext == "3") { - console.log("sdf"); - scope.mailB.subj = scope.mailA.subj; - scope.mailB.body = scope.mailA.body; - - } - else { - if (scope.whatnext == "2") { - scope.mailB.fromEmail = scope.mailA.fromEmail; - scope.mailB.body = scope.mailA.body; - - } - } - - - scope.save({ - "sequential": 1, - "name": "Aditya Nambiar", - "subject": scope.mailB.subj, - "created_id": "2", - "from_email": scope.mailB.fromEmail, - "body_text": scope.mailB.body - - }); - - }); - } - }; - - }); - - crmMailingAB.directive('nextbutton', function () { - return { - restrict: 'AE', - replace: 'true', - template: '
' + - '
' + - '' + - '
' - - }; - }); - - crmMailingAB.directive('cancelbutton', function () { - return { - restrict: 'AE', - replace: 'true', - template: '
' + - '
' + - '' + - '
' - - }; - }); - - crmMailingAB.directive('prevbutton', function () { - return { - restrict: 'AE', - replace: 'true', - template: '
' + - '
' + - '' + - '
' - - }; - }); + // Add a new record by name. + // Ex: + crmMailingAB.controller('ListingCtrl', function ($scope, crmApi) { + $scope.mailList = CRM.crmMailing.civiMails; + + }) + crmMailingAB.controller('TabsDemoCtrl', function ($scope, crmApi) { + + $scope.groups = CRM.crmMailing.groupNames; + $scope.mailList = CRM.crmMailing.civiMails; + + $scope.tab_val = 0; + $scope.max_tab = 0; + $scope.campaign_clicked = function () { + if ($scope.max_tab >= 0) { + $scope.tab_val = 0; + } + }; + $scope.compose_clicked = function () { + if ($scope.max_tab >= 1) { + $scope.tab_val = 1; + } + }; + $scope.rec_clicked = function () { + if ($scope.max_tab >= 2) { + $scope.tab_val = 2; + } + }; + $scope.preview_clicked = function () { + if ($scope.max_tab >= 3) { + $scope.tab_val = 3; + } + }; + $scope.templates = + [ + { name: 'Subject Lines', url: partialUrl('subject_lines.html')}, + { name: 'From Name', url: partialUrl('from_name.html')}, + {name: 'Two different Emails', url: partialUrl('two_emails.html')} + ]; + $scope.template = $scope.templates[0]; + + $scope.slide_value = 0; + + $scope.setifyes = function (val) { + if (val == 1) { + $scope.ifyes = true; + } + else { + $scope.ifyes = false; + } + }; + + $scope.send_date = "01/01/2000"; + + $scope.dt = ""; + + $scope.mailA = {}; + + $scope.mailB = {}; + $scope.save = function (dat) { + + var result = crmApi('Mailing', 'create', dat, true); + console.log("Ac " + result); + }; + + $scope.init = function (par) { + + $scope.whatnext = par.toString() + }; + + $scope.setdate = function (par) { + console.log("called") + console.log("av " + par) + $scope.send_date = par; + $scope.dt = par; + $scope.apply(); + }; + + $scope.scheddate = {}; + $scope.scheddate.date = "6"; + $scope.scheddate.time = ""; + $scope.incGroup = []; + $scope.excGroup = []; + + + }); + + crmMailingAB.directive('nexttab', function () { + return { + // Restrict it to be an attribute in this case + restrict: 'A', + + priority: 500, + // responsible for registering DOM listeners as well as updating the DOM + link: function (scope, element, attrs) { + + $(element).parent().parent().parent().parent().tabs(scope.$eval(attrs.nexttab)); + var myarr = new Array(1, 2, 3) + $(element).parent().parent().parent().parent().tabs({disabled: myarr}); + + $(element).on("click", function () { + scope.tab_val = scope.tab_val + 1; + + scope.max_tab = Math.max(scope.tab_val, scope.max_tab); + var myArray1 = new Array(); + for (var i = scope.max_tab + 1; i < 4; i++) { + myArray1.push(i); + } + $(element).parent().parent().parent().parent().parent().tabs("option", "disabled", myArray1); + $(element).parent().parent().parent().parent().parent().tabs("option", "active", scope.tab_val); + scope.$apply(); + console.log("Adir"); + }); + } + }; + }); + + crmMailingAB.directive('prevtab', function () { + return { + // Restrict it to be an attribute in this case + restrict: 'A', + priority: 500, + // responsible for registering DOM listeners as well as updating the DOM + link: function (scope, element, attrs) { + + + $(element).on("click", function () { + var temp = scope.tab_val - 1; + scope.tab_val = scope.tab_val - 1; + + console.log(temp); + if (temp == 3) { + + } + else { + $(element).parent().parent().parent().parent().parent().tabs("option", "active", temp); + } + + scope.$apply(); + + }); + } + }; + }); + + crmMailingAB.directive('groupselect', function () { + return { + restrict: 'AE', + link: function (scope, element, attrs) { + function format(item) { + if (!item.id) { + // return `text` for optgroup + return item.text; + } + // return item template + var a = item.id.split(" "); + if (a[1] == "group" && a[2] == "include") { + return "" + " " + "" + item.text; + } + if (a[1] == "group" && a[2] == "exclude") { + return "" + " " + "" + item.text; + } + if (a[1] == "mail" && a[2] == "include") { + return "" + " " + "" + item.text; + } + if (a[1] == "mail" && a[2] == "exclude") { + return "" + " " + "" + item.text; + } + } + + $(element).select2({ + width: "400px", + placeholder: "Select the groups you wish to include", + formatResult: format, + formatSelection: format, + escapeMarkup: function (m) { + return m; + } + }); + + $(element).on('select2-selecting', function (e) { + var a = e.val.split(" "); + var l = a.length; + if (a[2] == "include") { + var str = ""; + for (i = 3; i < l; i++) { + str += a[i]; + str += " "; + } + scope.incGroup.push(str); + scope.$apply(); + } + + else { + var str = ""; + for (i = 3; i < l; i++) { + str += a[i]; + str += " "; + } + + scope.excGroup.push(str); + scope.$apply(); + } + + }); + $(element).on("select2-removed", function (e) { + if (e.val.split(" ")[2] == "exclude") { + var index = scope.excGroup.indexOf(e.val.split(" ")[3]); + scope.excGroup.splice(index, 1); + scope.$apply(); + } + else { + var index = scope.incGroup.indexOf(e.val.split(" ")[3]); + scope.incGroup.splice(index, 1); + scope.$apply(); + } + }); + } + }; + + }); + + crmMailingAB.directive('sliderbar', function () { + return{ + restrict: 'AE', + link: function (scope, element, attrs) { + $(element).slider({min: 1}); + $(element).slider({ + slide: function (event, ui) { + scope.slide_value = ui.value; + scope.$apply(); + } + }); + } + }; + }); + + crmMailingAB.directive('tpmax', function () { + return { + restrict: 'E', + link: function (scope, element, attr) { + scope.$watch('automated', function (val) { + if (val == "Yes") { + $(element).dialog({ + title: 'Automated A/B Testing', + width: 800, + height: 600, + closed: false, + cache: false, + modal: true + }); + } + }); + + $(element).find("#closebutton").on("click", function () { + $(element).dialog("close"); + }); + } + }; + }); + + crmMailingAB.directive('numbar', function () { + return{ + restrict: 'AE', + link: function (scope, element, attrs) { + $(element).spinner({max: attrs.numbar, min: 0}); + } + }; + }); + + crmMailingAB.directive('datepick', function () { + return { + + + restrict: 'AE', + link: function (scope, element, attrs) { + $(element).datepicker({ + dateFormat: "yy-mm-dd", + onSelect: function (date) { + $(".ui-datepicker a").removeAttr("href"); + + scope.scheddate.date = date.toString(); + scope.$apply(); + console.log(scope.scheddate.date); + + } + + + }); + } + }; + }); + + crmMailingAB.directive('submitform', function () { + return { + restrict: 'A', + priority: 1000, + link: function (scope, element, attrs) { + $(element).on("click", function () { + + console.log("clicked"); + scope.save({ + "sequential": 1, + "name": "Aditya Nambiar", + "subject": scope.mailA.subj, + "created_id": "2", + "from_email": scope.mailA.fromEmail, + "body_text": scope.mailA.body + + }); + console.log("Truth " + scope.whatnext) + + if (scope.whatnext == "3") { + console.log("sdf"); + scope.mailB.subj = scope.mailA.subj; + scope.mailB.body = scope.mailA.body; + + } + else { + if (scope.whatnext == "2") { + scope.mailB.fromEmail = scope.mailA.fromEmail; + scope.mailB.body = scope.mailA.body; + + } + } + + + scope.save({ + "sequential": 1, + "name": "Aditya Nambiar", + "subject": scope.mailB.subj, + "created_id": "2", + "from_email": scope.mailB.fromEmail, + "body_text": scope.mailB.body + + }); + + }); + } + }; + + }); + + crmMailingAB.directive('nextbutton', function () { + return { + restrict: 'AE', + replace: 'true', + template: '
' + + '
' + + '' + + '
' + + }; + }); + + crmMailingAB.directive('cancelbutton', function () { + return { + restrict: 'AE', + replace: 'true', + template: '
' + + '
' + + '' + + '
' + + }; + }); + + crmMailingAB.directive('prevbutton', function () { + return { + restrict: 'AE', + replace: 'true', + template: '
' + + '
' + + '' + + '
' + + }; + }); })(angular, CRM.$, CRM._); diff --git a/partials/abtesting/list.html b/partials/abtesting/list.html new file mode 100644 index 0000000000..023dbcd6df --- /dev/null +++ b/partials/abtesting/list.html @@ -0,0 +1,14 @@ +
+Current Running AB Tests are + + + + + + + + + +

Name

Subject

{{ml.name}}{{ml.subject}}
+ +
\ No newline at end of file diff --git a/partials/abtesting/main.html b/partials/abtesting/main.html index 006420f006..62038e1dc5 100644 --- a/partials/abtesting/main.html +++ b/partials/abtesting/main.html @@ -1,169 +1,177 @@ - -
+
+ -
+
-
+ -

What would you like to test ?



+

What would you like to test ?



-   Subject Lines

-   From Names

-   Two different Emails

-  
+   Subject Lines

+   From Names

+   Two different Emails

+   +
+
-
-
- -
+ +
-
-
-
-
-
-
+
- +
+
+
+
+
-
- - -

Select the groups you would like to add


- - -  
- -



- {{incGroup}}
{{excGroup}} - -

Select the size of your test group


-   Percentage Selected - {{slide_value}}% - -
- -

How will the winner be decided


-   Open

-   Total Unique Clicks

-   Total Clicks on a particular link

- +

Declare the winner in how much time?


+   Days +   Hours +   Minutes +
  Please a Valid Time +
+
+
- ---> -

Declare the winner in how much time?


-   Days -   Hours -   Minutes -
  Please a Valid Time
-
-
+
+
+
-
-
-
+ +
- +
+ +

Details


+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Test Criteria{{template.name}}
Groups Included{{incGroup}}
Groups Excluded{{excGroup}}
Size of Test Group{{slide_value}}
Winner Criteria{{winner_criteria}}
Minum Confidence Level{{conf}}%
If Level not Achieved{{ifnot}}
Declare Winner in{{days}} Days {{hours}} Hours {{minutes}} Minutes
+ +

Preview Mailing


+ +

When to Start


+ +
+ Now   + Later + +     +
+ + +

+ +
+ +
+
+
+ +
+
-
- -

Details


- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Test Criteria{{template.name}}
Groups Included{{incGroup}}
Groups Excluded{{excGroup}}
Size of Test Group{{slide_value}}
Winner Criteria{{winner_criteria}}
Minum Confidence Level{{conf}}%
If Level not Achieved{{ifnot}}
Declare Winner in{{days}} Days {{hours}} Hours {{minutes}} Minutes
- -

Preview Mailing


- -

When to Start


-
- Now   - Later - -     -
- - -

-
- -
-
-
- -
-
-
- -
+
-
+
\ No newline at end of file diff --git a/tests/phpunit/CiviTest/CiviUnitTestCase.php b/tests/phpunit/CiviTest/CiviUnitTestCase.php index 9be2eda3cd..86e27d76d5 100644 --- a/tests/phpunit/CiviTest/CiviUnitTestCase.php +++ b/tests/phpunit/CiviTest/CiviUnitTestCase.php @@ -925,7 +925,7 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { throw new Exception('Invalid getcount result : ' . print_r($result, TRUE) . " type :" . gettype($result)); } if(is_int($count)){ - $this->assertEquals($count, $result, "incorect count returned from $entity getcount"); + $this->assertEquals($count, $result, "incorrect count returned from $entity getcount"); } return $result; } diff --git a/tests/phpunit/api/v3/MailingABTest.php b/tests/phpunit/api/v3/MailingABTest.php index e52b2c49aa..9e48d0e3bf 100644 --- a/tests/phpunit/api/v3/MailingABTest.php +++ b/tests/phpunit/api/v3/MailingABTest.php @@ -78,7 +78,7 @@ class api_v3_MailingABTest extends CiviUnitTestCase { * Test civicrm_mailing_create */ public function testMailingABCreateSuccess() { - $result = $this->callAPIAndDocument('MailingAB', 'create', $this->_params, __FUNCTION__, __FILE__); + $result = $this->callAPIAndDocument($this->_entity, 'create', $this->_params, __FUNCTION__, __FILE__); $this->assertTrue(is_numeric($result['id']), "In line " . __LINE__); $this->assertEquals($this->_params['group_percentage'], $result['values'][$result['id']]['group_percentage']); } @@ -88,7 +88,6 @@ class api_v3_MailingABTest extends CiviUnitTestCase { */ public function testMailerDeleteSuccess() { $result = $this->callAPISuccess($this->_entity, 'create', $this->_params); - $this->assertAPIDeleted($this->_entity, $result['id']); + $this->callAPISuccess($this->_entity, 'delete', array('id' => $result['id'])); } - } -- 2.25.1