File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / ext / intl / tests / bug62915-2.phpt
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Mon Jul 22 01:31:52 2013 UTC (11 years ago) by misho
Branches: php, MAIN
CVS tags: v5_4_29p0, v5_4_29, v5_4_20p0, v5_4_20, v5_4_17, HEAD
5.4.17

--TEST--
Bug #62915: cloning of several classes is defective
--SKIPIF--
<?php
if (!extension_loaded('intl'))
	    die('skip intl extension not enabled');
--FILE--
<?php
class A extends IntlDateFormatter {
		static $ARGS = array("en_US" ,IntlDateFormatter::FULL, IntlDateFormatter::FULL,
		    'America/Los_Angeles', IntlDateFormatter::GREGORIAN);
}
class B extends NumberFormatter {
		static $ARGS = array('de_DE', NumberFormatter::DECIMAL);
}
class C extends MessageFormatter {
		static $ARGS = array("en_US", "foo");
}
class D extends Spoofchecker {
		static $ARGS = array();
}

foreach (range('A', 'D') as $subclass) {
		$rc = new ReflectionClass($subclass);
			$obj = $rc->newInstanceArgs($subclass::$ARGS);
				$clone = clone $obj;
					var_dump(get_class($clone));
}
--EXPECT--
string(1) "A"
string(1) "B"
string(1) "C"
string(1) "D"

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>