Browse Source

- Add new tests

migration/RELEASE_1_0_0
Marcus Boerger 21 years ago
parent
commit
cb969bf938
  1. 31
      tests/classes/tostring_002.phpt
  2. 36
      tests/classes/tostring_003.phpt

31
tests/classes/tostring_002.phpt

@ -0,0 +1,31 @@
--TEST--
ZE2 __toString() in __destruct
--SKIPIF--
<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
--FILE--
<?php
class Test
{
function __toString()
{
return "Hello\n";
}
function __destruct()
{
echo $this;
}
}
$o = new Test;
$o = NULL;
$o = new Test;
?>
====DONE====
--EXPECTF--
Hello
====DONE====
Hello

36
tests/classes/tostring_003.phpt

@ -0,0 +1,36 @@
--TEST--
ZE2 __toString() in __destruct/exception
--SKIPIF--
<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
--FILE--
<?php
class Test
{
function __toString()
{
throw new Exception("Damn!");
return "Hello\n";
}
function __destruct()
{
echo $this;
}
}
try
{
$o = new Test;
$o = NULL;
}
catch(Exception $e)
{
var_dump($e->getMessage());
}
?>
====DONE====
--EXPECTF--
string(5) "Damn!"
====DONE====
Loading…
Cancel
Save