Annotation of embedaddon/php/ext/reflection/tests/ReflectionParameter_DefaultValueConstant_basic2.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: ReflectionParameter::isDefaultValueConstant() && getDefaultValueConstantName() for namespace
! 3: --FILE--
! 4: <?php
! 5:
! 6: namespace ReflectionTestNamespace {
! 7: CONST TEST_CONST_1 = "Test Const 1";
! 8:
! 9: class TestClass {
! 10: const TEST_CONST_2 = "Test Const 2 in class";
! 11: }
! 12: }
! 13:
! 14: namespace {
! 15: function ReflectionParameterTest($test=ReflectionTestNamespace\TestClass::TEST_CONST_2, $test2 = ReflectionTestNamespace\CONST_TEST_1) {
! 16: echo $test;
! 17: }
! 18: $reflect = new ReflectionFunction('ReflectionParameterTest');
! 19: foreach($reflect->getParameters() as $param) {
! 20: if($param->isDefaultValueAvailable() && $param->isDefaultValueConstant()) {
! 21: echo $param->getDefaultValueConstantName() . "\n";
! 22: }
! 23: }
! 24: echo "==DONE==";
! 25: }
! 26: ?>
! 27: --EXPECT--
! 28: ReflectionTestNamespace\TestClass::TEST_CONST_2
! 29: ReflectionTestNamespace\CONST_TEST_1
! 30: ==DONE==
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>