Annotation of embedaddon/php/ext/phar/tests/phar_oo_001U.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Phar object: basics
! 3: --SKIPIF--
! 4: <?php
! 5: if (!extension_loaded("phar")) die("skip");
! 6: if (version_compare(PHP_VERSION, "6.0", "<")) die("skip Unicode support required");
! 7: if (!extension_loaded("spl")) die("skip SPL not available");
! 8: ?>
! 9: --INI--
! 10: phar.require_hash=0
! 11: phar.readonly=0
! 12: --FILE--
! 13: <?php
! 14:
! 15: require_once 'files/phar_oo_test.inc';
! 16:
! 17: $phar = new Phar($fname);
! 18: var_dump($phar->getVersion());
! 19: var_dump(count($phar));
! 20:
! 21: class MyPhar extends Phar
! 22: {
! 23: function __construct()
! 24: {
! 25: }
! 26: }
! 27:
! 28: try
! 29: {
! 30: $phar = new MyPhar();
! 31: var_dump($phar->getVersion());
! 32: }
! 33: catch (BadMethodCallException $e)
! 34: {
! 35: var_dump($e->getMessage());
! 36: }
! 37: try {
! 38: $phar = new Phar('test.phar');
! 39: $phar->__construct('oops');
! 40: } catch (BadMethodCallException $e)
! 41: {
! 42: var_dump($e->getMessage());
! 43: }
! 44:
! 45: ?>
! 46: ===DONE===
! 47: --CLEAN--
! 48: <?php
! 49: unlink(dirname(__FILE__) . '/files/phar_oo_test.phar.php');
! 50: __halt_compiler();
! 51: ?>
! 52: --EXPECT--
! 53: string(5) "1.0.0"
! 54: int(5)
! 55: unicode(50) "Cannot call method on an uninitialized Phar object"
! 56: unicode(29) "Cannot call constructor twice"
! 57: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>