File: ldif_importFile.phpt

package info (click to toggle)
turba2 2.2.1-2
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 7,332 kB
  • ctags: 2,927
  • sloc: php: 11,046; xml: 1,690; sql: 507; makefile: 62; perl: 17; sh: 1
file content (85 lines) | stat: -rw-r--r-- 1,812 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
--TEST--
Import Simple LDIF file, LF terminated
--FILE--
<?php

error_reporting(E_ALL);

require 'Horde.php';
require 'Horde/Data.php';
require dirname(__FILE__) . '/../Data/ldif.php';

$data = new Horde_Data_ldif();
var_dump($data->importFile(dirname(__FILE__) . '/import.ldif', false));

?>
--EXPECT--
array(2) {
  [0]=>
  array(4) {
    ["givenName"]=>
    string(4) "John"
    ["sn"]=>
    string(5) "Smith"
    ["cn"]=>
    string(10) "John Smith"
    ["mail"]=>
    string(15) "js23@school.edu"
  }
  [1]=>
  array(26) {
    ["givenName"]=>
    string(7) "Charles"
    ["sn"]=>
    string(5) "Brown"
    ["cn"]=>
    string(13) "Charlie Brown"
    ["mozillaNickname"]=>
    string(5) "Chuck"
    ["mail"]=>
    string(16) "brown@school.edu"
    ["telephoneNumber"]=>
    string(15) "+1 212 876 5432"
    ["homePhone"]=>
    string(15) "+1 203 234 5678"
    ["fax"]=>
    string(15) "+1 203 999 9999"
    ["mobile"]=>
    string(15) "+1 917 321 0987"
    ["homeStreet"]=>
    string(17) "12 west 57 street"
    ["mozillaHomeStreet2"]=>
    string(8) "Apt 2076"
    ["mozillaHomeLocalityName"]=>
    string(8) "New York"
    ["mozillaHomeState"]=>
    string(8) "New York"
    ["mozillaHomePostalCode"]=>
    string(5) "10001"
    ["mozillaHomeCountryName"]=>
    string(3) "USA"
    ["street"]=>
    string(19) "12 West 55th Street"
    ["mozillaWorkStreet2"]=>
    string(7) "Room 22"
    ["l"]=>
    string(8) "New York"
    ["st"]=>
    string(8) "New York"
    ["postalCode"]=>
    string(5) "10001"
    ["c"]=>
    string(3) "USA"
    ["title"]=>
    string(25) "Senior Systems Programmer"
    ["department"]=>
    string(4) "CUIT"
    ["company"]=>
    string(17) "School University"
    ["mozillaWorkUrl"]=>
    string(22) "http://www.school.edu/"
    ["description"]=>
    string(7) "hi mom
"
  }
}