LP1818288 WS Option to pre-fetch record holds
[working/Evergreen.git] / Open-ILS / src / eg2 / src / test_data / eg_mock.js
1 /**
2  * Mock data required by multiple unit tests.
3  */
4
5 window._eg_mock_data = {
6
7     // builds a mock org unit tree fleshed with ou_types and
8     // absorbs the tree into egEnv
9     generateOrgTree : function(idlService, orgService) {
10         var type1 = idlService.create('aout');
11         type1.id(1);
12         type1.depth(0);
13
14         var type2 = idlService.create('aout');
15         type2.id(2);
16         type2.depth(1);
17         type2.parent(1);
18
19         var type3 = idlService.create('aout');
20         type3.id(3);
21         type3.depth(2);
22         type3.parent(2);
23
24         var org1 = idlService.create('aou'); 
25         org1.id(1);
26         org1.ou_type(type1);
27         org1.shortname('ROOT');
28
29         var org2 = idlService.create('aou'); 
30         org2.id(2); 
31         org2.parent_ou(1);
32         org2.ou_type(type2);
33
34         var org3 = idlService.create('aou'); 
35         org3.id(3); 
36         org3.parent_ou(1);
37         org3.ou_type(type2);
38
39         var org4 = idlService.create('aou'); 
40         org4.id(4); 
41         org4.parent_ou(2);
42         org4.ou_type(type3);
43
44         org1.children([org2, org3]);
45         org2.children([org4]);
46         org3.children([]);
47         org4.children([]);
48
49         orgService.orgTree = org1;
50         orgService.absorbTree();
51     }
52 }