diff options
Diffstat (limited to 'ext/com_dotnet/tests')
-rw-r--r-- | ext/com_dotnet/tests/27974.phpt | 38 | ||||
-rw-r--r-- | ext/com_dotnet/tests/bug33386.phpt | 26 | ||||
-rw-r--r-- | ext/com_dotnet/tests/bug34272.phpt | 12 | ||||
-rw-r--r-- | ext/com_dotnet/tests/bug39596.phpt | 12 | ||||
-rw-r--r-- | ext/com_dotnet/tests/bug39606.phpt | 2 | ||||
-rw-r--r-- | ext/com_dotnet/tests/bug45280.phpt | 3 | ||||
-rw-r--r-- | ext/com_dotnet/tests/bug49192.phpt | 14 | ||||
-rw-r--r-- | ext/com_dotnet/tests/bug66431_0.phpt | 6 | ||||
-rw-r--r-- | ext/com_dotnet/tests/bug66431_1.phpt | 6 | ||||
-rw-r--r-- | ext/com_dotnet/tests/bug73679.phpt | 2 | ||||
-rw-r--r-- | ext/com_dotnet/tests/bug77177.phpt | 2 | ||||
-rw-r--r-- | ext/com_dotnet/tests/bug77578.phpt | 2 | ||||
-rw-r--r-- | ext/com_dotnet/tests/bug77621.phpt | 2 | ||||
-rw-r--r-- | ext/com_dotnet/tests/variants.phpt | 44 | ||||
-rw-r--r-- | ext/com_dotnet/tests/variants_x64.phpt | 44 |
15 files changed, 95 insertions, 120 deletions
diff --git a/ext/com_dotnet/tests/27974.phpt b/ext/com_dotnet/tests/27974.phpt index 960a630304..c76dda9ed5 100644 --- a/ext/com_dotnet/tests/27974.phpt +++ b/ext/com_dotnet/tests/27974.phpt @@ -8,26 +8,26 @@ if (!extension_loaded("com_dotnet")) print "skip COM/.Net support not present"; error_reporting(E_ALL); try { - $v = new VARIANT(array("123", "456", "789")); - var_dump($v); - print $v[0] . "\n"; - print $v[1] . "\n"; - print $v[2] . "\n"; - $v[1] = "hello"; - foreach ($v as $item) { - var_dump($item); - } - try { - $v[3] = "shouldn't work"; - } catch (com_exception $e) { - if ($e->getCode() != DISP_E_BADINDEX) { - throw $e; - } - echo "Got BADINDEX exception OK!\n"; - } - echo "OK!"; + $v = new VARIANT(array("123", "456", "789")); + var_dump($v); + print $v[0] . "\n"; + print $v[1] . "\n"; + print $v[2] . "\n"; + $v[1] = "hello"; + foreach ($v as $item) { + var_dump($item); + } + try { + $v[3] = "shouldn't work"; + } catch (com_exception $e) { + if ($e->getCode() != DISP_E_BADINDEX) { + throw $e; + } + echo "Got BADINDEX exception OK!\n"; + } + echo "OK!"; } catch (Exception $e) { - print $e; + print $e; } ?> --EXPECT-- diff --git a/ext/com_dotnet/tests/bug33386.phpt b/ext/com_dotnet/tests/bug33386.phpt index 102e69749b..7f305d2eb5 100644 --- a/ext/com_dotnet/tests/bug33386.phpt +++ b/ext/com_dotnet/tests/bug33386.phpt @@ -15,22 +15,22 @@ class twoFuncs { } try { - $ciTF = new twoFuncs; + $ciTF = new twoFuncs; - $oScript = new COM("MSScriptControl.ScriptControl"); - $oScript->Language = "VBScript"; + $oScript = new COM("MSScriptControl.ScriptControl"); + $oScript->Language = "VBScript"; - $oScript->AddObject ("tfA", $ciTF, true); - foreach (array(1,2) as $i) { - $oScript->ExecuteStatement ("tfA.func$i"); - $oScript->ExecuteStatement ("func$i"); - } - $oScript->AddObject ("tfB", $ciTF); - foreach (array(1,2) as $i) { - $oScript->ExecuteStatement ("tfB.func$i"); - } + $oScript->AddObject ("tfA", $ciTF, true); + foreach (array(1,2) as $i) { + $oScript->ExecuteStatement ("tfA.func$i"); + $oScript->ExecuteStatement ("func$i"); + } + $oScript->AddObject ("tfB", $ciTF); + foreach (array(1,2) as $i) { + $oScript->ExecuteStatement ("tfB.func$i"); + } } catch (Exception $e) { - print $e; + print $e; } ?> --EXPECT-- diff --git a/ext/com_dotnet/tests/bug34272.phpt b/ext/com_dotnet/tests/bug34272.phpt index feb63c93c3..ce8a552dfd 100644 --- a/ext/com_dotnet/tests/bug34272.phpt +++ b/ext/com_dotnet/tests/bug34272.phpt @@ -8,13 +8,13 @@ if (!extension_loaded("com_dotnet")) print "skip COM/.Net support not present"; error_reporting(E_ALL); try { - $dict = new COM("Scripting.Dictionary"); - $dict->add('foo', array()); - print sizeof($dict['foo'])."\n"; - $dict->add('bar', array(23)); - print sizeof($dict['bar'])." \n"; + $dict = new COM("Scripting.Dictionary"); + $dict->add('foo', array()); + print sizeof($dict['foo'])."\n"; + $dict->add('bar', array(23)); + print sizeof($dict['bar'])." \n"; } catch (Exception $e) { - print $e; + print $e; } ?> --EXPECT-- diff --git a/ext/com_dotnet/tests/bug39596.phpt b/ext/com_dotnet/tests/bug39596.phpt index bd89326560..1510db49cf 100644 --- a/ext/com_dotnet/tests/bug39596.phpt +++ b/ext/com_dotnet/tests/bug39596.phpt @@ -8,13 +8,13 @@ if (!extension_loaded("com_dotnet")) print "skip COM/.Net support not present"; error_reporting(E_ALL); try { - $binding_string = array('aaa','bbb','ccc'); - $v = new VARIANT( $binding_string, VT_ARRAY ); - foreach ($v AS $element) { - print $element."\n"; - } + $binding_string = array('aaa','bbb','ccc'); + $v = new VARIANT( $binding_string, VT_ARRAY ); + foreach ($v AS $element) { + print $element."\n"; + } } catch (Exception $e) { - print $e; + print $e; } ?> --EXPECT-- diff --git a/ext/com_dotnet/tests/bug39606.phpt b/ext/com_dotnet/tests/bug39606.phpt index 314e9ce8a2..f646c6a7c3 100644 --- a/ext/com_dotnet/tests/bug39606.phpt +++ b/ext/com_dotnet/tests/bug39606.phpt @@ -15,8 +15,6 @@ $typelib = $root.'\activeds.tlb'; var_dump(com_load_typelib($typelib)); var_dump(com_load_typelib($typelib)); ?> -===DONE=== --EXPECT-- bool(true) bool(true) -===DONE=== diff --git a/ext/com_dotnet/tests/bug45280.phpt b/ext/com_dotnet/tests/bug45280.phpt index b530083cca..393799e374 100644 --- a/ext/com_dotnet/tests/bug45280.phpt +++ b/ext/com_dotnet/tests/bug45280.phpt @@ -8,8 +8,9 @@ if (!extension_loaded("com_dotnet")){ echo "skip COM/.Net support not present"; <?php $dict = new COM("Scripting.Dictionary"); +$reflection = new ReflectionObject($dict); ob_start(); -ReflectionObject::export($dict); +echo $reflection; ob_get_clean(); echo 'done'; diff --git a/ext/com_dotnet/tests/bug49192.phpt b/ext/com_dotnet/tests/bug49192.phpt index e16c1358b1..cd85a9a64c 100644 --- a/ext/com_dotnet/tests/bug49192.phpt +++ b/ext/com_dotnet/tests/bug49192.phpt @@ -3,23 +3,9 @@ Bug #49192 (PHP crashes when GC invoked on COM object) --SKIPIF-- <?php if (!extension_loaded("com_dotnet")) print "skip COM/.Net support not present"; ?> ---XFAIL-- -1 --FILE-- <?php -// this test fails to load ADO -// -// a change in windows longhorn x64(affecting vista, 7, 8, 2008, 2008r2) broke ADO. -// -// there is a fix available, but user has to install it. -// given that ADO was deprecated a long time ago in favor of newer APIs, -// I don't think its worth the trouble of making the user install the fix to -// get an accurate test run. its better to just not run the test or expect it to fail. -// -// see: http://support.microsoft.com/kb/2517589 -// see: http://www.infoq.com/news/2011/10/ADO-Win7 - $dbConnection = new Com('ADODB.Connection'); var_dump(gc_collect_cycles()); ?> diff --git a/ext/com_dotnet/tests/bug66431_0.phpt b/ext/com_dotnet/tests/bug66431_0.phpt index e022c18e12..4a0062a7e1 100644 --- a/ext/com_dotnet/tests/bug66431_0.phpt +++ b/ext/com_dotnet/tests/bug66431_0.phpt @@ -22,12 +22,11 @@ $result = ($check_text == $text); var_dump($result); if (!$result) { - echo "Expected: '$check_text'\n"; - echo "Have: '$text'\n"; + echo "Expected: '$check_text'\n"; + echo "Have: '$text'\n"; } ?> -===DONE=== --CLEAN-- <?php @@ -39,4 +38,3 @@ if (file_exists($fpath)) { ?> --EXPECT-- bool(true) -===DONE=== diff --git a/ext/com_dotnet/tests/bug66431_1.phpt b/ext/com_dotnet/tests/bug66431_1.phpt index e68e411125..e99131d27b 100644 --- a/ext/com_dotnet/tests/bug66431_1.phpt +++ b/ext/com_dotnet/tests/bug66431_1.phpt @@ -40,12 +40,11 @@ $result = (trim($check_text) == $text); var_dump($result); if (!$result) { - echo "Expected: '$check_text'\n"; - echo "Have: '$text'\n"; + echo "Expected: '$check_text'\n"; + echo "Have: '$text'\n"; } ?> -===DONE=== --CLEAN-- <?php @@ -57,4 +56,3 @@ if (file_exists($fpath)) { ?> --EXPECT-- bool(true) -===DONE=== diff --git a/ext/com_dotnet/tests/bug73679.phpt b/ext/com_dotnet/tests/bug73679.phpt index 47de9b10c7..235fd3e33e 100644 --- a/ext/com_dotnet/tests/bug73679.phpt +++ b/ext/com_dotnet/tests/bug73679.phpt @@ -17,6 +17,6 @@ echo $stack->Pop() . $stack->Pop(); --EXPECTF-- Fatal error: Uncaught com_exception: Could not create .Net object - invalid codepage! in %sbug73679.php:%d Stack trace: -#0 %sbug73679.php(%d): dotnet->dotnet('mscorlib', 'System.Collecti...', -2200000000) +#0 %sbug73679.php(%d): dotnet->__construct('mscorlib', 'System.Collecti...', -2200000000) #1 {main} thrown in %sbug73679.php on line %d diff --git a/ext/com_dotnet/tests/bug77177.phpt b/ext/com_dotnet/tests/bug77177.phpt index 901358248c..8fcfd5a378 100644 --- a/ext/com_dotnet/tests/bug77177.phpt +++ b/ext/com_dotnet/tests/bug77177.phpt @@ -31,7 +31,6 @@ foreach ($strings as $string) { var_dump(unserialize($string)); } ?> -===DONE=== --EXPECTF-- Exception: Serialization of 'com' is not allowed Exception: Serialization of 'dotnet' is not allowed @@ -54,4 +53,3 @@ Warning: Erroneous data format for unserializing 'variant' in %s on line %d Notice: unserialize(): Error at offset 17 of 18 bytes in %s on line %d bool(false) -===DONE=== diff --git a/ext/com_dotnet/tests/bug77578.phpt b/ext/com_dotnet/tests/bug77578.phpt index e68494468e..910f24909b 100644 --- a/ext/com_dotnet/tests/bug77578.phpt +++ b/ext/com_dotnet/tests/bug77578.phpt @@ -15,9 +15,7 @@ $command = "$php $iniopt -d com.autoregister_typelib=1 -r \"new COM('WbemScripti exec($command, $output, $status); var_dump($output, $status); ?> -===DONE=== --EXPECT-- array(0) { } int(0) -===DONE=== diff --git a/ext/com_dotnet/tests/bug77621.phpt b/ext/com_dotnet/tests/bug77621.phpt index 5c24494637..32e879dcd0 100644 --- a/ext/com_dotnet/tests/bug77621.phpt +++ b/ext/com_dotnet/tests/bug77621.phpt @@ -12,7 +12,5 @@ define('ADSTYPE_INVALID', 0); $root = dirname(array_change_key_case($_SERVER, CASE_UPPER)['COMSPEC']); com_load_typelib("$root\activeds.tlb"); ?> -===DONE=== --EXPECTF-- Warning: com_load_typelib(): Type library constant ADSTYPE_INVALID is already defined in %s on line %d -===DONE=== diff --git a/ext/com_dotnet/tests/variants.phpt b/ext/com_dotnet/tests/variants.phpt index a99e896680..0bcd473f61 100644 --- a/ext/com_dotnet/tests/variants.phpt +++ b/ext/com_dotnet/tests/variants.phpt @@ -10,34 +10,34 @@ error_reporting(E_ALL); $v = new VARIANT(); if (VT_EMPTY != variant_get_type($v)) { - echo "VT_EMPTY: bork\n"; + echo "VT_EMPTY: bork\n"; } $values = array(VT_I4 => 42, VT_R8 => 3.5, VT_BSTR => "hello", VT_BOOL => false); $binary_ops = array('add', 'cat', 'sub', 'mul', 'and', 'div', - 'eqv', 'idiv', 'imp', 'mod', 'or', 'pow', 'xor'); + 'eqv', 'idiv', 'imp', 'mod', 'or', 'pow', 'xor'); foreach ($values as $t => $val) { - $v = new VARIANT($val); - if ($t != variant_get_type($v)) { - printf("Bork: [%d] %d: %s\n", $t, variant_get_type($v), $val); - print $v . "\n"; - } - $results = array(); - - foreach ($values as $op2) { - echo "--\n"; - foreach ($binary_ops as $op) { - try { - echo "$op: " . call_user_func('variant_' . $op, $v, $op2) . "\n"; - } catch (com_exception $e) { - echo "$op:\n"; - echo "\tvariant_$op($v, $op2)\n"; - echo "\texception " . $e->getMessage(); - printf("\tcode %08x\n\n", $e->getCode()); - } - } - } + $v = new VARIANT($val); + if ($t != variant_get_type($v)) { + printf("Bork: [%d] %d: %s\n", $t, variant_get_type($v), $val); + print $v . "\n"; + } + $results = array(); + + foreach ($values as $op2) { + echo "--\n"; + foreach ($binary_ops as $op) { + try { + echo "$op: " . call_user_func('variant_' . $op, $v, $op2) . "\n"; + } catch (com_exception $e) { + echo "$op:\n"; + echo "\tvariant_$op($v, $op2)\n"; + echo "\texception " . $e->getMessage(); + printf("\tcode %08x\n\n", $e->getCode()); + } + } + } } echo "OK!"; diff --git a/ext/com_dotnet/tests/variants_x64.phpt b/ext/com_dotnet/tests/variants_x64.phpt index e9e7c23b97..88f9f3e126 100644 --- a/ext/com_dotnet/tests/variants_x64.phpt +++ b/ext/com_dotnet/tests/variants_x64.phpt @@ -13,34 +13,34 @@ error_reporting(E_ALL); $v = new VARIANT(); if (VT_EMPTY != variant_get_type($v)) { - echo "VT_EMPTY: bork\n"; + echo "VT_EMPTY: bork\n"; } $values = array(VT_I8 => 42, VT_R8 => 3.5, VT_BSTR => "hello", VT_BOOL => false); $binary_ops = array('add', 'cat', 'sub', 'mul', 'and', 'div', - 'eqv', 'idiv', 'imp', 'mod', 'or', 'pow', 'xor'); + 'eqv', 'idiv', 'imp', 'mod', 'or', 'pow', 'xor'); foreach ($values as $t => $val) { - $v = new VARIANT($val); - if ($t != variant_get_type($v)) { - printf("Bork: [%d] %d: %s\n", $t, variant_get_type($v), $val); - print $v . "\n"; - } - $results = array(); - - foreach ($values as $op2) { - echo "--\n"; - foreach ($binary_ops as $op) { - try { - echo "$op: " . call_user_func('variant_' . $op, $v, $op2) . "\n"; - } catch (com_exception $e) { - echo "$op:\n"; - echo "\tvariant_$op($v, $op2)\n"; - echo "\texception " . $e->getMessage(); - printf("\tcode %08x\n\n", $e->getCode()); - } - } - } + $v = new VARIANT($val); + if ($t != variant_get_type($v)) { + printf("Bork: [%d] %d: %s\n", $t, variant_get_type($v), $val); + print $v . "\n"; + } + $results = array(); + + foreach ($values as $op2) { + echo "--\n"; + foreach ($binary_ops as $op) { + try { + echo "$op: " . call_user_func('variant_' . $op, $v, $op2) . "\n"; + } catch (com_exception $e) { + echo "$op:\n"; + echo "\tvariant_$op($v, $op2)\n"; + echo "\texception " . $e->getMessage(); + printf("\tcode %08x\n\n", $e->getCode()); + } + } + } } echo "OK!"; |