File:
[ELWIX - Embedded LightWeight unIX -] /
embedaddon /
php /
ext /
phar /
tests /
phar_oo_006.phpt
Revision
1.1.1.1 (vendor branch):
download - view:
text,
annotated -
select for diffs -
revision graph
Tue Feb 21 23:47:59 2012 UTC (12 years, 6 months ago) by
misho
Branches:
php,
MAIN
CVS tags:
v5_4_3elwix,
v5_4_29p0,
v5_4_29,
v5_4_20p0,
v5_4_20,
v5_4_17p0,
v5_4_17,
v5_3_10,
HEAD
php
--TEST--
Phar object: array access
--SKIPIF--
<?php if (!extension_loaded("phar")) die("skip"); ?>
<?php if (!extension_loaded("spl")) die("skip SPL not available"); ?>
--INI--
phar.require_hash=0
--FILE--
<?php
require_once 'files/phar_oo_test.inc';
class MyFile extends SplFileObject
{
function __construct($what)
{
echo __METHOD__ . "($what)\n";
parent::__construct($what);
}
}
$phar = new Phar($fname);
try
{
$phar->setFileClass('SplFileInfo');
}
catch (UnexpectedValueException $e)
{
echo $e->getMessage() . "\n";
}
$phar->setInfoClass('MyFile');
echo $phar['a.php']->getFilename() . "\n";
echo $phar['b/c.php']->getFilename() . "\n";
echo $phar['b.php']->getFilename() . "\n";
?>
===DONE===
--CLEAN--
<?php
unlink(dirname(__FILE__) . '/files/phar_oo_test.phar.php');
__halt_compiler();
?>
--EXPECTF--
SplFileInfo::setFileClass() expects parameter 1 to be a class name derived from SplFileObject, 'SplFileInfo' given
MyFile::__construct(phar://%s/a.php)
a.php
MyFile::__construct(phar://%s/b/c.php)
c.php
MyFile::__construct(phar://%s/b.php)
b.php
===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>