xref: /PHP-5.3/ext/com_dotnet/tests/bug33386.phpt (revision b7ec6f90)
1--TEST--
2Bug #33386 (ScriptControl only sees last function of class)
3--SKIPIF--
4<?php
5if (!extension_loaded("com_dotnet")) print "skip COM/.Net support not present"; ?>
6--FILE--
7<?php
8error_reporting(E_ALL);
9
10class twoFuncs {
11    public function func1() { echo " func one\n"; }
12    public function func2() { echo " func two\n"; }
13}
14
15try {
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
41