Annotation of embedaddon/php/ext/com_dotnet/tests/bug33386.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Bug #33386 (ScriptControl only sees last function of class)
! 3: --SKIPIF--
! 4: <?php
! 5: if (!extension_loaded("com_dotnet")) print "skip COM/.Net support not present"; ?>
! 6: --FILE--
! 7: <?php
! 8: error_reporting(E_ALL);
! 9:
! 10: class twoFuncs {
! 11: public function func1() { echo " func one\n"; }
! 12: public function func2() { echo " func two\n"; }
! 13: }
! 14:
! 15: try {
! 16: $ciTF = new twoFuncs;
! 17:
! 18: $oScript = new COM("MSScriptControl.ScriptControl");
! 19: $oScript->Language = "VBScript";
! 20:
! 21: $oScript->AddObject ("tfA", $ciTF, true);
! 22: foreach (array(1,2) as $i) {
! 23: $oScript->ExecuteStatement ("tfA.func$i");
! 24: $oScript->ExecuteStatement ("func$i");
! 25: }
! 26: $oScript->AddObject ("tfB", $ciTF);
! 27: foreach (array(1,2) as $i) {
! 28: $oScript->ExecuteStatement ("tfB.func$i");
! 29: }
! 30: } catch (Exception $e) {
! 31: print $e;
! 32: }
! 33: ?>
! 34: --EXPECT--
! 35: func one
! 36: func one
! 37: func two
! 38: func two
! 39: func one
! 40: func two
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>