2
PEAR_Common::infoFromString test
5
if (!getenv('PHP_PEAR_RUNTESTS')) {
8
if (!function_exists('token_get_all')) {
14
putenv('PHP_PEAR_SYSCONF_DIR=' . dirname(__FILE__));
16
require_once "PEAR/Common.php";
18
$common = &new PEAR_Common;
20
PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, 'catchit');
22
function catchit($err)
24
echo "Caught error: " . $err->getMessage() . "\n";
27
echo "Test invalid XML\n";
29
$common->infoFromString('\\goober');
31
echo "Test valid XML, not a package.xml\n";
33
$common->infoFromString('<?xml version="1.0" encoding="ISO-8859-1" ?>' .
34
"\n<grobbage></grobbage>");
36
echo "Test valid package.xml, invalid version number\n";
38
$common->infoFromString('<?xml version="1.0" encoding="ISO-8859-1" ?>' .
39
'<package version="10000000"></package>');
41
echo "Test empty package.xml\n";
43
$ret = $common->infoFromString('<?xml version="1.0" encoding="ISO-8859-1" ?>' .
44
'<package version="1.0"></package>');
50
$ret = $common->infoFromString('<?xml version="1.0" encoding="ISO-8859-1" ?>' .
51
'<package version="1.0"><name>test</name></package>');
57
$ret = $common->infoFromString('<?xml version="1.0" encoding="ISO-8859-1" ?>' .
58
'<package version="1.0"><name>test</name><summary>PEAR test</summary>' .
65
$ret = $common->infoFromString('<?xml version="1.0" encoding="ISO-8859-1" ?>' .
66
'<package version="1.0"><name>test</name><summary>PEAR test</summary>' .
67
'<description>The test</description></package>');
73
$ret = $common->infoFromString('<?xml version="1.0" encoding="ISO-8859-1" ?>' .
74
'<package version="1.0"><name>test</name><summary>PEAR test</summary>' .
75
'<description>The test</description><license>PHP License</license></package>');
81
$ret = $common->infoFromString('<?xml version="1.0" encoding="ISO-8859-1" ?>' .
82
'<package version="1.0"><name>test</name><summary>PEAR test</summary>' .
83
'<description>The test</description><license>PHP License</license> <maintainers>
87
<name>test tester</name>
88
<email>test@php.net</email>
89
</maintainer></maintainers>
96
$ret = $common->infoFromString('<?xml version="1.0" encoding="ISO-8859-1" ?>' .
97
'<package version="1.0"><name>test</name><summary>PEAR test</summary>' .
98
'<description>The test</description><license>PHP License</license> <maintainers>
102
<name>test tester</name>
103
<email>test@php.net</email>
104
</maintainer></maintainers><release>
105
<version>1.3b4</version></release>
112
$ret = $common->infoFromString('<?xml version="1.0" encoding="ISO-8859-1" ?>' .
113
'<package version="1.0"><name>test</name><summary>PEAR test</summary>' .
114
'<description>The test</description><license>PHP License</license> <maintainers>
118
<name>test tester</name>
119
<email>test@php.net</email>
120
</maintainer></maintainers><release>
121
<version>1.3b4</version>
122
<date>2003-11-17</date>
124
<notes>test</notes></release>
131
$ret = $common->infoFromString('<?xml version="1.0" encoding="ISO-8859-1" ?>' .
132
'<package version="1.0"><name>test</name><summary>PEAR test</summary>' .
133
'<description>The test</description><license>PHP License</license> <maintainers>
137
<name>test tester</name>
138
<email>test@php.net</email>
139
</maintainer></maintainers><release>
140
<version>1.3b4</version>
141
<date>2003-11-17</date>
144
<provides type="class" name="furngy" /></release>
151
$ret = $common->infoFromString('<?xml version="1.0" encoding="ISO-8859-1" ?>' .
152
'<package version="1.0"><name>test</name><summary>PEAR test</summary>' .
153
'<description>The test</description><license>PHP License</license> <maintainers>
157
<name>test tester</name>
158
<email>test@php.net</email>
159
</maintainer></maintainers><release>
160
<version>1.3b4</version>
161
<date>2003-11-17</date>
164
<provides type="class" name="furngy" />
166
<dep type="ext" rel="has" optional="yes">xmlrpc</dep>
175
$ret = $common->infoFromString('<?xml version="1.0" encoding="ISO-8859-1" ?>' .
176
'<package version="1.0"><name>test</name><summary>PEAR test</summary>' .
177
'<description>The test</description><license>PHP License</license> <maintainers>
181
<name>test tester</name>
182
<email>test@php.net</email>
183
</maintainer></maintainers><release>
184
<version>1.3b4</version>
185
<date>2003-11-17</date>
188
<provides type="class" name="furngy" />
190
<dep type="ext" rel="has" optional="yes">xmlrpc</dep>
193
<file role="data" name="package.dtd"/>
194
<file role="data" name="template.spec"/>
195
<file role="php" name="PEAR.php"/>
196
<file role="php" name="System.php"/>
198
<file role="php" name="Autoloader.php"/>
199
<file role="php" name="Command.php"/>
201
<file role="php" name="Auth.php"/>
202
<file role="php" name="Build.php"/>
203
<file role="php" name="Common.php"/>
204
<file role="php" name="Config.php"/>
205
<file role="php" name="Install.php"/>
206
<file role="php" name="Package.php"/>
207
<file role="php" name="Registry.php"/>
208
<file role="php" name="Remote.php"/>
209
<file role="php" name="Mirror.php"/>
211
<file role="php" name="Common.php"/>
212
<file role="php" name="Config.php"/>
213
<file role="php" name="Dependency.php"/>
214
<dir name="Frontend">
215
<file role="php" name="CLI.php"/>
217
<file role="php" name="Builder.php"/>
218
<file role="php" name="Installer.php"/>
219
<file role="php" name="Packager.php"/>
220
<file role="php" name="Registry.php"/>
221
<file role="php" name="Remote.php"/>
224
<file role="php" name="Guess.php"/>
226
<dir name="scripts" baseinstalldir="/">
227
<file role="script" install-as="pear" name="pear.sh">
228
<replace from="@php_bin@" to="php_bin" type="pear-config"/>
229
<replace from="@php_dir@" to="php_dir" type="pear-config"/>
230
<replace from="@pear_version@" to="version" type="package-info"/>
231
<replace from="@include_path@" to="php_dir" type="pear-config"/>
233
<file role="script" platform="windows" install-as="pear.bat" name="pear.bat">
234
<replace from="@bin_dir@" to="bin_dir" type="pear-config"/>
235
<replace from="@php_bin@" to="php_bin" type="pear-config"/>
236
<replace from="@include_path@" to="php_dir" type="pear-config"/>
238
<file role="php" install-as="pearcmd.php" name="pearcmd.php">
239
<replace from="@php_bin@" to="php_bin" type="pear-config"/>
240
<replace from="@php_dir@" to="php_dir" type="pear-config"/>
241
<replace from="@pear_version@" to="version" type="package-info"/>
242
<replace from="@include_path@" to="php_dir" type="pear-config"/>
254
$ret = $common->infoFromString('<?xml version="1.0" encoding="ISO-8859-1" ?>' .
255
'<package version="1.0"><name>test</name><summary>PEAR test</summary>' .
256
'<description>The test</description><license>PHP License</license> <maintainers>
260
<name>test tester</name>
261
<email>test@php.net</email>
262
</maintainer></maintainers><release>
263
<version>1.3b4</version>
264
<date>2003-11-17</date>
267
<provides type="class" name="furngy" />
269
<dep type="ext" rel="has" optional="yes">xmlrpc</dep>
272
<file role="data" name="package.dtd"/>
273
<file role="data" name="template.spec"/>
274
<file role="php" name="PEAR.php"/>
275
<file role="php" name="System.php"/>
277
<file role="php" name="Autoloader.php"/>
278
<file role="php" name="Command.php"/>
280
<file role="php" name="Auth.php"/>
281
<file role="php" name="Build.php"/>
282
<file role="php" name="Common.php"/>
283
<file role="php" name="Config.php"/>
284
<file role="php" name="Install.php"/>
285
<file role="php" name="Package.php"/>
286
<file role="php" name="Registry.php"/>
287
<file role="php" name="Remote.php"/>
288
<file role="php" name="Mirror.php"/>
290
<file role="php" name="Common.php"/>
291
<file role="php" name="Config.php"/>
292
<file role="php" name="Dependency.php"/>
293
<dir name="Frontend">
294
<file role="php" name="CLI.php"/>
296
<file role="php" name="Builder.php"/>
297
<file role="php" name="Installer.php"/>
298
<file role="php" name="Packager.php"/>
299
<file role="php" name="Registry.php"/>
300
<file role="php" name="Remote.php"/>
303
<file role="php" name="Guess.php"/>
305
<dir name="scripts" baseinstalldir="/">
306
<file role="script" install-as="pear" name="pear.sh">
307
<replace from="@php_bin@" to="php_bin" type="pear-config"/>
308
<replace from="@php_dir@" to="php_dir" type="pear-config"/>
309
<replace from="@pear_version@" to="version" type="package-info"/>
310
<replace from="@include_path@" to="php_dir" type="pear-config"/>
312
<file role="script" platform="windows" install-as="pear.bat" name="pear.bat">
313
<replace from="@bin_dir@" to="bin_dir" type="pear-config"/>
314
<replace from="@php_bin@" to="php_bin" type="pear-config"/>
315
<replace from="@include_path@" to="php_dir" type="pear-config"/>
317
<file role="php" install-as="pearcmd.php" name="pearcmd.php">
318
<replace from="@php_bin@" to="php_bin" type="pear-config"/>
319
<replace from="@php_dir@" to="php_dir" type="pear-config"/>
320
<replace from="@pear_version@" to="version" type="package-info"/>
321
<replace from="@include_path@" to="php_dir" type="pear-config"/>
326
<configureoption name="test" prompt="The prompt test" default="foo" />
335
$ret = $common->infoFromString('<?xml version="1.0" encoding="ISO-8859-1" ?>' .
336
'<package version="1.0"><name>test</name><summary>PEAR test</summary>' .
337
'<description>The test</description><license>PHP License</license> <maintainers>
341
<name>test tester</name>
342
<email>test@php.net</email>
343
</maintainer></maintainers><release>
344
<version>1.3b4</version>
345
<date>2003-11-17</date>
348
<provides type="class" name="furngy" />
350
<dep type="ext" rel="has" optional="yes">xmlrpc</dep>
353
<file role="data" name="package.dtd"/>
354
<file role="data" name="template.spec"/>
355
<file role="php" name="PEAR.php"/>
356
<file role="php" name="System.php"/>
358
<file role="php" name="Autoloader.php"/>
359
<file role="php" name="Command.php"/>
361
<file role="php" name="Auth.php"/>
362
<file role="php" name="Build.php"/>
363
<file role="php" name="Common.php"/>
364
<file role="php" name="Config.php"/>
365
<file role="php" name="Install.php"/>
366
<file role="php" name="Package.php"/>
367
<file role="php" name="Registry.php"/>
368
<file role="php" name="Remote.php"/>
369
<file role="php" name="Mirror.php"/>
371
<file role="php" name="Common.php"/>
372
<file role="php" name="Config.php"/>
373
<file role="php" name="Dependency.php"/>
374
<dir name="Frontend">
375
<file role="php" name="CLI.php"/>
377
<file role="php" name="Builder.php"/>
378
<file role="php" name="Installer.php"/>
379
<file role="php" name="Packager.php"/>
380
<file role="php" name="Registry.php"/>
381
<file role="php" name="Remote.php"/>
384
<file role="php" name="Guess.php"/>
386
<dir name="scripts" baseinstalldir="/">
387
<file role="script" install-as="pear" name="pear.sh">
388
<replace from="@php_bin@" to="php_bin" type="pear-config"/>
389
<replace from="@php_dir@" to="php_dir" type="pear-config"/>
390
<replace from="@pear_version@" to="version" type="package-info"/>
391
<replace from="@include_path@" to="php_dir" type="pear-config"/>
393
<file role="script" platform="windows" install-as="pear.bat" name="pear.bat">
394
<replace from="@bin_dir@" to="bin_dir" type="pear-config"/>
395
<replace from="@php_bin@" to="php_bin" type="pear-config"/>
396
<replace from="@include_path@" to="php_dir" type="pear-config"/>
398
<file role="php" install-as="pearcmd.php" name="pearcmd.php">
399
<replace from="@php_bin@" to="php_bin" type="pear-config"/>
400
<replace from="@php_dir@" to="php_dir" type="pear-config"/>
401
<replace from="@pear_version@" to="version" type="package-info"/>
402
<replace from="@include_path@" to="php_dir" type="pear-config"/>
407
<configureoption name="test" prompt="The prompt test" default="foo" />
412
<version>0.1</version>
413
<date>2003-07-21</date>
414
<license>PHP License</license>
416
<notes>First release of test</notes>
419
<version>0.2</version>
420
<date>2003-07-21</date>
421
<license>PHP License</license>
423
<notes>Generation of package.xml from scratch is now supported. In addition,
424
generation of <provides> is supported and so is addition of
425
maintainers and configure options
427
- Fixed a bug in <release> generation
428
- Added _addProvides() to generate a <provides> section</notes>
438
Caught error: XML error: not well-formed (invalid token) at line 1
439
Test valid XML, not a package.xml
440
Caught error: Invalid Package File, no <package> tag
441
Test valid package.xml, invalid version number
442
Caught error: No handlers for package.xml version 10000000
443
Test empty package.xml
474
string(9) "PEAR test"
487
string(9) "PEAR test"
502
string(9) "PEAR test"
505
["release_license"]=>
506
string(11) "PHP License"
519
string(9) "PEAR test"
522
["release_license"]=>
523
string(11) "PHP License"
533
string(11) "test tester"
535
string(12) "test@php.net"
550
string(9) "PEAR test"
553
["release_license"]=>
554
string(11) "PHP License"
564
string(11) "test tester"
566
string(12) "test@php.net"
583
string(9) "PEAR test"
586
["release_license"]=>
587
string(11) "PHP License"
597
string(11) "test tester"
599
string(12) "test@php.net"
605
string(10) "2003-11-17"
631
string(9) "PEAR test"
634
["release_license"]=>
635
string(11) "PHP License"
645
string(11) "test tester"
647
string(12) "test@php.net"
653
string(10) "2003-11-17"
679
string(9) "PEAR test"
682
["release_license"]=>
683
string(11) "PHP License"
693
string(11) "test tester"
695
string(12) "test@php.net"
701
string(10) "2003-11-17"
757
["PEAR\Autoloader.php"]=>
762
["PEAR\Command.php"]=>
767
["PEAR\Command\Auth.php"]=>
772
["PEAR\Command\Build.php"]=>
777
["PEAR\Command\Common.php"]=>
782
["PEAR\Command\Config.php"]=>
787
["PEAR\Command\Install.php"]=>
792
["PEAR\Command\Package.php"]=>
797
["PEAR\Command\Registry.php"]=>
802
["PEAR\Command\Remote.php"]=>
807
["PEAR\Command\Mirror.php"]=>
812
["PEAR\Common.php"]=>
817
["PEAR\Config.php"]=>
822
["PEAR\Dependency.php"]=>
827
["PEAR\Frontend\CLI.php"]=>
832
["PEAR\Builder.php"]=>
837
["PEAR\Installer.php"]=>
842
["PEAR\Packager.php"]=>
847
["PEAR\Registry.php"]=>
852
["PEAR\Remote.php"]=>
862
["scripts\pear.sh"]=>
875
string(9) "@php_bin@"
879
string(11) "pear-config"
884
string(9) "@php_dir@"
888
string(11) "pear-config"
893
string(14) "@pear_version@"
897
string(12) "package-info"
902
string(14) "@include_path@"
906
string(11) "pear-config"
910
["scripts\pear.bat"]=>
925
string(9) "@bin_dir@"
929
string(11) "pear-config"
934
string(9) "@php_bin@"
938
string(11) "pear-config"
943
string(14) "@include_path@"
947
string(11) "pear-config"
951
["scripts\pearcmd.php"]=>
956
string(11) "pearcmd.php"
964
string(9) "@php_bin@"
968
string(11) "pear-config"
973
string(9) "@php_dir@"
977
string(11) "pear-config"
982
string(14) "@pear_version@"
986
string(12) "package-info"
991
string(14) "@include_path@"
995
string(11) "pear-config"
1003
string(9) "PEAR test"
1005
string(8) "The test"
1006
["release_license"]=>
1007
string(11) "PHP License"
1017
string(11) "test tester"
1019
string(12) "test@php.net"
1025
string(10) "2003-11-17"
1081
["PEAR\Autoloader.php"]=>
1086
["PEAR\Command.php"]=>
1091
["PEAR\Command\Auth.php"]=>
1096
["PEAR\Command\Build.php"]=>
1101
["PEAR\Command\Common.php"]=>
1106
["PEAR\Command\Config.php"]=>
1111
["PEAR\Command\Install.php"]=>
1116
["PEAR\Command\Package.php"]=>
1121
["PEAR\Command\Registry.php"]=>
1126
["PEAR\Command\Remote.php"]=>
1131
["PEAR\Command\Mirror.php"]=>
1136
["PEAR\Common.php"]=>
1141
["PEAR\Config.php"]=>
1146
["PEAR\Dependency.php"]=>
1151
["PEAR\Frontend\CLI.php"]=>
1156
["PEAR\Builder.php"]=>
1161
["PEAR\Installer.php"]=>
1166
["PEAR\Packager.php"]=>
1171
["PEAR\Registry.php"]=>
1176
["PEAR\Remote.php"]=>
1186
["scripts\pear.sh"]=>
1192
["baseinstalldir"]=>
1199
string(9) "@php_bin@"
1203
string(11) "pear-config"
1208
string(9) "@php_dir@"
1212
string(11) "pear-config"
1217
string(14) "@pear_version@"
1221
string(12) "package-info"
1226
string(14) "@include_path@"
1230
string(11) "pear-config"
1234
["scripts\pear.bat"]=>
1241
string(8) "pear.bat"
1242
["baseinstalldir"]=>
1249
string(9) "@bin_dir@"
1253
string(11) "pear-config"
1258
string(9) "@php_bin@"
1262
string(11) "pear-config"
1267
string(14) "@include_path@"
1271
string(11) "pear-config"
1275
["scripts\pearcmd.php"]=>
1280
string(11) "pearcmd.php"
1281
["baseinstalldir"]=>
1288
string(9) "@php_bin@"
1292
string(11) "pear-config"
1297
string(9) "@php_dir@"
1301
string(11) "pear-config"
1306
string(14) "@pear_version@"
1310
string(12) "package-info"
1315
string(14) "@include_path@"
1319
string(11) "pear-config"
1327
string(9) "PEAR test"
1329
string(8) "The test"
1330
["release_license"]=>
1331
string(11) "PHP License"
1341
string(11) "test tester"
1343
string(12) "test@php.net"
1349
string(10) "2003-11-17"
1368
["configure_options"]=>
1375
string(15) "The prompt test"
1417
["PEAR\Autoloader.php"]=>
1422
["PEAR\Command.php"]=>
1427
["PEAR\Command\Auth.php"]=>
1432
["PEAR\Command\Build.php"]=>
1437
["PEAR\Command\Common.php"]=>
1442
["PEAR\Command\Config.php"]=>
1447
["PEAR\Command\Install.php"]=>
1452
["PEAR\Command\Package.php"]=>
1457
["PEAR\Command\Registry.php"]=>
1462
["PEAR\Command\Remote.php"]=>
1467
["PEAR\Command\Mirror.php"]=>
1472
["PEAR\Common.php"]=>
1477
["PEAR\Config.php"]=>
1482
["PEAR\Dependency.php"]=>
1487
["PEAR\Frontend\CLI.php"]=>
1492
["PEAR\Builder.php"]=>
1497
["PEAR\Installer.php"]=>
1502
["PEAR\Packager.php"]=>
1507
["PEAR\Registry.php"]=>
1512
["PEAR\Remote.php"]=>
1522
["scripts\pear.sh"]=>
1528
["baseinstalldir"]=>
1535
string(9) "@php_bin@"
1539
string(11) "pear-config"
1544
string(9) "@php_dir@"
1548
string(11) "pear-config"
1553
string(14) "@pear_version@"
1557
string(12) "package-info"
1562
string(14) "@include_path@"
1566
string(11) "pear-config"
1570
["scripts\pear.bat"]=>
1577
string(8) "pear.bat"
1578
["baseinstalldir"]=>
1585
string(9) "@bin_dir@"
1589
string(11) "pear-config"
1594
string(9) "@php_bin@"
1598
string(11) "pear-config"
1603
string(14) "@include_path@"
1607
string(11) "pear-config"
1611
["scripts\pearcmd.php"]=>
1616
string(11) "pearcmd.php"
1617
["baseinstalldir"]=>
1624
string(9) "@php_bin@"
1628
string(11) "pear-config"
1633
string(9) "@php_dir@"
1637
string(11) "pear-config"
1642
string(14) "@pear_version@"
1646
string(12) "package-info"
1651
string(14) "@include_path@"
1655
string(11) "pear-config"
1663
string(9) "PEAR test"
1665
string(8) "The test"
1666
["release_license"]=>
1667
string(11) "PHP License"
1677
string(11) "test tester"
1679
string(12) "test@php.net"
1685
string(10) "2003-11-17"
1704
["configure_options"]=>
1711
string(15) "The prompt test"
1723
string(10) "2003-07-21"
1724
["release_license"]=>
1725
string(11) "PHP License"
1729
string(22) "First release of test
1737
string(10) "2003-07-21"
1738
["release_license"]=>
1739
string(11) "PHP License"
1743
string(260) "Generation of package.xml from scratch is now supported. In addition,
1744
generation of <provides> is supported and so is addition of
1745
maintainers and configure options
1747
- Fixed a bug in <release> generation
1748
- Added _addProvides() to generate a <provides> section
b'\\ No newline at end of file'