File: test_windows.phpt

package info (click to toggle)
php-pear 1%3A1.10.16%2Bsubmodules%2Bnotgz-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 18,576 kB
  • sloc: php: 52,994; ansic: 39,986; xml: 33,278; yacc: 677; pascal: 452; makefile: 122; sh: 114
file content (282 lines) | stat: -rw-r--r-- 8,264 bytes parent folder | download | duplicates (5)
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
--TEST--
config-create command --windows
--SKIPIF--
<?php
if (!getenv('PHP_PEAR_RUNTESTS')) {
    echo 'skip';
}
?>
--FILE--
<?php

require_once dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'setup.php.inc';
$temp_path2 = str_replace(DIRECTORY_SEPARATOR, '\\', $temp_path);
$e = $command->run('config-create', array('windows' => true), array($temp_path2 . DIRECTORY_SEPARATOR . 'nomake', $temp_path . DIRECTORY_SEPARATOR
    . 'remote.ini'));
$phpunit->assertNoErrors('log errors');
$log = $fakelog->getLog();
$log[0]['info']['data']['Internet Access'] = array_slice($log[0]['info']['data']['Internet Access'], 0, 6);
$log[0]['info']['data']['File Locations'] = array_slice($log[0]['info']['data']['File Locations'], 0, 4);
$log[0]['info']['data']['File Locations (Advanced)'] = array_slice($log[0]['info']['data']['File Locations (Advanced)'], 0, 13);
$log[0]['info']['data']['Advanced'] = array_slice($log[0]['info']['data']['Advanced'], 0, 4);
$log[0]['info']['data']['Maintainers'] = array_slice($log[0]['info']['data']['Maintainers'], 0, 6);
$phpunit->assertEquals(array (
  0 =>
  array (
    'info' =>
    array (
      'caption' => 'Configuration (channel pear.php.net):',
      'data' =>
      array (
        'Internet Access' =>
        array (
          0 =>
          array (
            0 => 'Auto-discover new Channels',
            1 => 'auto_discover',
            2 => NULL,
          ),
          1 =>
          array (
            0 => 'Default Channel',
            1 => 'default_channel',
            2 => 'pear.php.net',
          ),
          2 =>
          array (
            0 => 'HTTP Proxy Server Address',
            1 => 'http_proxy',
            2 => NULL,
          ),
          3 =>
          array (
            0 => 'PEAR server [DEPRECATED]',
            1 => 'master_server',
            2 => NULL,
          ),
          4 =>
          array (
            0 => 'Default Channel Mirror',
            1 => 'preferred_mirror',
            2 => NULL,
          ),
          5 =>
          array (
            0 => 'Remote Configuration File',
            1 => 'remote_config',
            2 => NULL,
          ),
        ),
        'File Locations' =>
        array (
          0 =>
          array (
            0 => 'PEAR executables directory',
            1 => 'bin_dir',
            2 => '' . $temp_path2 . '\\nomake\\pear',
          ),
          1 =>
          array (
            0 => 'PEAR documentation directory',
            1 => 'doc_dir',
            2 => '' . $temp_path2 . '\\nomake\\pear\\docs',
          ),
          2 =>
          array (
            0 => 'PHP extension directory',
            1 => 'ext_dir',
            2 => '' . $temp_path2 . '\\nomake\\pear\\ext',
          ),
          3 =>
          array (
            0 => 'PEAR directory',
            1 => 'php_dir',
            2 => '' . $temp_path2 . '\\nomake\\pear\\php',
          ),
        ),
        'File Locations (Advanced)' =>
        array (
          array (
            0 => 'PEAR Installer cache directory',
            1 => 'cache_dir',
            2 => '' . $temp_path2 . '\\nomake\\pear\\cache',
          ),
          array (
            0 => 'PEAR configuration file directory',
            1 => 'cfg_dir',
            2 => $temp_path2 . '\\nomake\\pear\\cfg',
          ),
          array (
            0 => 'PEAR data directory',
            1 => 'data_dir',
            2 => '' . $temp_path2 . '\\nomake\\pear\\data',
          ),
          array (
            0 => 'PEAR Installer download directory',
            1 => 'download_dir',
            2 => $temp_path2 . '\\nomake\\pear\\download',
          ),
          array (
            0 => 'Systems manpage files directory',
            1 => 'man_dir',
            2 => $temp_path2 . '\\nomake\\pear\\man',
          ),
          array (
            0 => 'PEAR metadata directory',
            1 => 'metadata_dir',
            2 => NULL,
          ),
          array (
            0 => 'PHP CLI/CGI binary',
            1 => 'php_bin',
            2 => NULL,
          ),
          array (
            0 => 'php.ini location',
            1 => 'php_ini',
            2 => NULL,
          ),
          array (
            0 => '--program-prefix passed to PHP\'s ./configure',
            1 => 'php_prefix',
            2 => NULL,
          ),
          array (
            0 => '--program-suffix passed to PHP\'s ./configure',
            1 => 'php_suffix',
            2 => NULL,
          ),
          array (
            0 => 'PEAR Installer temp directory',
            1 => 'temp_dir',
            2 => $temp_path2 . '\\nomake\\pear\\temp',
          ),
          array (
            0 => 'PEAR test directory',
            1 => 'test_dir',
            2 => '' . $temp_path2 . '\\nomake\\pear\\tests',
          ),
          array (
            0 => 'PEAR www files directory',
            1 => 'www_dir',
            2 => '' . $temp_path2 . '\\nomake\\pear\\www',
          ),
        ),
        'Advanced' =>
        array (
          0 =>
          array (
            0 => 'Cache TimeToLive',
            1 => 'cache_ttl',
            2 => NULL,
          ),
          1 =>
          array (
            0 => 'Preferred Package State',
            1 => 'preferred_state',
            2 => NULL,
          ),
          2 =>
          array (
            0 => 'Unix file mask',
            1 => 'umask',
            2 => NULL,
          ),
          3 =>
          array (
            0 => 'Debug Log Level',
            1 => 'verbose',
            2 => NULL,
          ),
        ),
        'Maintainers' =>
        array (
          0 =>
          array (
            0 => 'PEAR password (for maintainers)',
            1 => 'password',
            2 => NULL,
          ),
          1 =>
          array (
            0 => 'Signature Handling Program',
            1 => 'sig_bin',
            2 => NULL,
          ),
          2 =>
          array (
            0 => 'Signature Key Directory',
            1 => 'sig_keydir',
            2 => NULL,
          ),
          3 =>
          array (
            0 => 'Signature Key Id',
            1 => 'sig_keyid',
            2 => NULL,
          ),
          4 =>
          array (
            0 => 'Package Signature Type',
            1 => 'sig_type',
            2 => NULL,
          ),
          5 =>
          array (
            0 => 'PEAR username (for maintainers)',
            1 => 'username',
            2 => NULL,
          ),
        ),
        'Config Files' =>
        array (
          0 =>
          array (
            0 => 'User Configuration File',
            1 => 'Filename',
            2 => $temp_path . DIRECTORY_SEPARATOR . 'remote.ini',
          ),
          1 =>
          array (
            0 => 'System Configuration File',
            1 => 'Filename',
            2 => '#no#system#config#',
          ),
        ),
      ),
    ),
    'cmd' => 'config-show',
  ),
  1 =>
  array (
    'info' => 'Successfully created default configuration file "' .
    $temp_path . DIRECTORY_SEPARATOR . 'remote.ini"',
    'cmd' => 'config-create',
  ),
), $log, 'log');
$phpunit->assertFileExists($temp_path . DIRECTORY_SEPARATOR . 'remote.ini', 'not created');
$contents = explode("\n", implode('', file($temp_path . DIRECTORY_SEPARATOR . 'remote.ini')));
$contents = unserialize($contents[1]);
$config->readConfigFile($temp_path . DIRECTORY_SEPARATOR . 'remote.ini');
$phpunit->assertEquals(array (
  'php_dir' => $temp_path2 . '\\nomake\\pear\\php',
  'data_dir' => $temp_path2 . '\\nomake\\pear\\data',
  'www_dir' => $temp_path2 . '\\nomake\\pear\\www',
  'cfg_dir' => $temp_path2 . '\\nomake\\pear\\cfg',
  'ext_dir' => $temp_path2 . '\\nomake\\pear\\ext',
  'doc_dir' => $temp_path2 . '\\nomake\\pear\\docs',
  'test_dir' => $temp_path2 . '\\nomake\\pear\\tests',
  'cache_dir' => $temp_path2 . '\\nomake\\pear\\cache',
  'download_dir' => $temp_path2 . '\\nomake\\pear\\download',
  'temp_dir' => $temp_path2 . '\\nomake\\pear\\temp',
  'bin_dir' => $temp_path2 . '\\nomake\\pear',
  'man_dir' => $temp_path2 . '\\nomake\\pear\\man',
), $contents, 'ok');
echo 'tests done';
?>
--CLEAN--
<?php
require_once dirname(dirname(__FILE__)) . '/teardown.php.inc';
?>
--EXPECT--
tests done