This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class TestSubjectFactory { | |
public static function testArray($params) { | |
$params = array_merge(array( | |
'overrides' => array(), | |
), $params); | |
switch ($params['entity']) { | |
case 'group': | |
$defaults = array( | |
'name' => 'Test Group 1', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var CRMModel = Backbone.Model.extend({ | |
// redirect sync to custom method | |
sync: this.crmSync, | |
// Custom bridge to V3 civicrm API | |
crmSync: function(method, model, options) { | |
// make a shallow copy of options ? uneccesary but seems safest?? | |
var params = _.clone(options); | |
// look up this models enity (as either method or property) | |
var entity = _.result(this, 'entity'); | |
var action = ''; // is there a good value to pass the api to throw error? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Plan for testing: | |
- insert contact A | |
- insert contact B | |
- read contact B -> get contact B | |
- automerge (A, B) -> get expected SUCCESS result | |
- read contact B -> get nothing back | |
- read contact A -> get back merged A and B, store as $A | |
- insert contact C (different in some important way from A) |