Annotation of embedaddon/php/ext/intl/tests/bug62915-2.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Bug #62915: cloning of several classes is defective
! 3: --SKIPIF--
! 4: <?php
! 5: if (!extension_loaded('intl'))
! 6: die('skip intl extension not enabled');
! 7: --FILE--
! 8: <?php
! 9: class A extends IntlDateFormatter {
! 10: static $ARGS = array("en_US" ,IntlDateFormatter::FULL, IntlDateFormatter::FULL,
! 11: 'America/Los_Angeles', IntlDateFormatter::GREGORIAN);
! 12: }
! 13: class B extends NumberFormatter {
! 14: static $ARGS = array('de_DE', NumberFormatter::DECIMAL);
! 15: }
! 16: class C extends MessageFormatter {
! 17: static $ARGS = array("en_US", "foo");
! 18: }
! 19: class D extends Spoofchecker {
! 20: static $ARGS = array();
! 21: }
! 22:
! 23: foreach (range('A', 'D') as $subclass) {
! 24: $rc = new ReflectionClass($subclass);
! 25: $obj = $rc->newInstanceArgs($subclass::$ARGS);
! 26: $clone = clone $obj;
! 27: var_dump(get_class($clone));
! 28: }
! 29: --EXPECT--
! 30: string(1) "A"
! 31: string(1) "B"
! 32: string(1) "C"
! 33: string(1) "D"
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>