Annotation of embedaddon/php/ext/phar/tests/phar_oo_006.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Phar object: array access
3: --SKIPIF--
4: <?php if (!extension_loaded("phar")) die("skip"); ?>
5: <?php if (!extension_loaded("spl")) die("skip SPL not available"); ?>
6: --INI--
7: phar.require_hash=0
8: --FILE--
9: <?php
10:
11: require_once 'files/phar_oo_test.inc';
12:
13: class MyFile extends SplFileObject
14: {
15: function __construct($what)
16: {
17: echo __METHOD__ . "($what)\n";
18: parent::__construct($what);
19: }
20: }
21:
22: $phar = new Phar($fname);
23: try
24: {
25: $phar->setFileClass('SplFileInfo');
26: }
27: catch (UnexpectedValueException $e)
28: {
29: echo $e->getMessage() . "\n";
30: }
31: $phar->setInfoClass('MyFile');
32:
33: echo $phar['a.php']->getFilename() . "\n";
34: echo $phar['b/c.php']->getFilename() . "\n";
35: echo $phar['b.php']->getFilename() . "\n";
36:
37: ?>
38: ===DONE===
39: --CLEAN--
40: <?php
41: unlink(dirname(__FILE__) . '/files/phar_oo_test.phar.php');
42: __halt_compiler();
43: ?>
44: --EXPECTF--
45: SplFileInfo::setFileClass() expects parameter 1 to be a class name derived from SplFileObject, 'SplFileInfo' given
46: MyFile::__construct(phar://%s/a.php)
47: a.php
48: MyFile::__construct(phar://%s/b/c.php)
49: c.php
50: MyFile::__construct(phar://%s/b.php)
51: b.php
52: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>