diff options
author | Frédéric Guillot <fred@kanboard.net> | 2017-12-15 11:24:35 -0800 |
---|---|---|
committer | Frédéric Guillot <fred@kanboard.net> | 2017-12-15 11:55:42 -0800 |
commit | a93b8e10f5954be0853eec693c13e84c4bd9e6f2 (patch) | |
tree | eda5de9494b819235616e8623bb3393e9cc373af /vendor/symfony/debug/Resources/ext/tests | |
parent | 2c72a283f2d51034f85f4e2ca8b194d304a3c433 (diff) |
Kanboard requires at least PHP 5.6 now
Diffstat (limited to 'vendor/symfony/debug/Resources/ext/tests')
-rw-r--r-- | vendor/symfony/debug/Resources/ext/tests/001.phpt | 153 | ||||
-rw-r--r-- | vendor/symfony/debug/Resources/ext/tests/002.phpt | 63 | ||||
-rw-r--r-- | vendor/symfony/debug/Resources/ext/tests/002_1.phpt | 46 | ||||
-rw-r--r-- | vendor/symfony/debug/Resources/ext/tests/003.phpt | 85 |
4 files changed, 347 insertions, 0 deletions
diff --git a/vendor/symfony/debug/Resources/ext/tests/001.phpt b/vendor/symfony/debug/Resources/ext/tests/001.phpt new file mode 100644 index 00000000..15e183a7 --- /dev/null +++ b/vendor/symfony/debug/Resources/ext/tests/001.phpt @@ -0,0 +1,153 @@ +--TEST-- +Test symfony_zval_info API +--SKIPIF-- +<?php if (!extension_loaded('symfony_debug')) print 'skip'; ?> +--FILE-- +<?php + +$int = 42; +$float = 42.42; +$str = 'foobar'; +$object = new StdClass(); +$array = array('foo', 'bar'); +$resource = tmpfile(); +$null = null; +$bool = true; + +$anotherint = 42; +$refcount2 = &$anotherint; + +$var = array( + 'int' => $int, + 'float' => $float, + 'str' => $str, + 'object' => $object, + 'array' => $array, + 'resource' => $resource, + 'null' => $null, + 'bool' => $bool, + 'refcount' => &$refcount2, +); + +var_dump(symfony_zval_info('int', $var)); +var_dump(symfony_zval_info('float', $var)); +var_dump(symfony_zval_info('str', $var)); +var_dump(symfony_zval_info('object', $var)); +var_dump(symfony_zval_info('array', $var)); +var_dump(symfony_zval_info('resource', $var)); +var_dump(symfony_zval_info('null', $var)); +var_dump(symfony_zval_info('bool', $var)); + +var_dump(symfony_zval_info('refcount', $var)); +var_dump(symfony_zval_info('not-exist', $var)); +?> +--EXPECTF-- +array(4) { + ["type"]=> + string(7) "integer" + ["zval_hash"]=> + string(16) "%s" + ["zval_refcount"]=> + int(2) + ["zval_isref"]=> + bool(false) +} +array(4) { + ["type"]=> + string(6) "double" + ["zval_hash"]=> + string(16) "%s" + ["zval_refcount"]=> + int(2) + ["zval_isref"]=> + bool(false) +} +array(5) { + ["type"]=> + string(6) "string" + ["zval_hash"]=> + string(16) "%s" + ["zval_refcount"]=> + int(2) + ["zval_isref"]=> + bool(false) + ["strlen"]=> + int(6) +} +array(8) { + ["type"]=> + string(6) "object" + ["zval_hash"]=> + string(16) "%s" + ["zval_refcount"]=> + int(2) + ["zval_isref"]=> + bool(false) + ["object_class"]=> + string(8) "stdClass" + ["object_refcount"]=> + int(1) + ["object_hash"]=> + string(32) "%s" + ["object_handle"]=> + int(%d) +} +array(5) { + ["type"]=> + string(5) "array" + ["zval_hash"]=> + string(16) "%s" + ["zval_refcount"]=> + int(2) + ["zval_isref"]=> + bool(false) + ["array_count"]=> + int(2) +} +array(7) { + ["type"]=> + string(8) "resource" + ["zval_hash"]=> + string(16) "%s" + ["zval_refcount"]=> + int(2) + ["zval_isref"]=> + bool(false) + ["resource_handle"]=> + int(%d) + ["resource_type"]=> + string(6) "stream" + ["resource_refcount"]=> + int(1) +} +array(4) { + ["type"]=> + string(4) "NULL" + ["zval_hash"]=> + string(16) "%s" + ["zval_refcount"]=> + int(2) + ["zval_isref"]=> + bool(false) +} +array(4) { + ["type"]=> + string(7) "boolean" + ["zval_hash"]=> + string(16) "%s" + ["zval_refcount"]=> + int(2) + ["zval_isref"]=> + bool(false) +} +array(4) { + ["type"]=> + string(7) "integer" + ["zval_hash"]=> + string(16) "%s" + ["zval_refcount"]=> + int(3) + ["zval_isref"]=> + bool(true) +} +NULL diff --git a/vendor/symfony/debug/Resources/ext/tests/002.phpt b/vendor/symfony/debug/Resources/ext/tests/002.phpt new file mode 100644 index 00000000..2bc6d712 --- /dev/null +++ b/vendor/symfony/debug/Resources/ext/tests/002.phpt @@ -0,0 +1,63 @@ +--TEST-- +Test symfony_debug_backtrace in case of fatal error +--SKIPIF-- +<?php if (!extension_loaded('symfony_debug')) print 'skip'; ?> +--FILE-- +<?php + +function bar() +{ + foo(); +} + +function foo() +{ + notexist(); +} + +function bt() +{ + print_r(symfony_debug_backtrace()); +} + +register_shutdown_function('bt'); + +bar(); + +?> +--EXPECTF-- +Fatal error: Call to undefined function notexist() in %s on line %d +Array +( + [0] => Array + ( + [function] => bt + [args] => Array + ( + ) + + ) + + [1] => Array + ( + [file] => %s + [line] => %d + [function] => foo + [args] => Array + ( + ) + + ) + + [2] => Array + ( + [file] => %s + [line] => %d + [function] => bar + [args] => Array + ( + ) + + ) + +) diff --git a/vendor/symfony/debug/Resources/ext/tests/002_1.phpt b/vendor/symfony/debug/Resources/ext/tests/002_1.phpt new file mode 100644 index 00000000..4e9e34f1 --- /dev/null +++ b/vendor/symfony/debug/Resources/ext/tests/002_1.phpt @@ -0,0 +1,46 @@ +--TEST-- +Test symfony_debug_backtrace in case of non fatal error +--SKIPIF-- +<?php if (!extension_loaded('symfony_debug')) print 'skip'; ?> +--FILE-- +<?php + +function bar() +{ + bt(); +} + +function bt() +{ + print_r(symfony_debug_backtrace()); +} + +bar(); + +?> +--EXPECTF-- +Array +( + [0] => Array + ( + [file] => %s + [line] => %d + [function] => bt + [args] => Array + ( + ) + + ) + + [1] => Array + ( + [file] => %s + [line] => %d + [function] => bar + [args] => Array + ( + ) + + ) + +) diff --git a/vendor/symfony/debug/Resources/ext/tests/003.phpt b/vendor/symfony/debug/Resources/ext/tests/003.phpt new file mode 100644 index 00000000..2a494e27 --- /dev/null +++ b/vendor/symfony/debug/Resources/ext/tests/003.phpt @@ -0,0 +1,85 @@ +--TEST-- +Test ErrorHandler in case of fatal error +--SKIPIF-- +<?php if (!extension_loaded('symfony_debug')) print 'skip'; ?> +--FILE-- +<?php + +namespace Psr\Log; + +class LogLevel +{ + const EMERGENCY = 'emergency'; + const ALERT = 'alert'; + const CRITICAL = 'critical'; + const ERROR = 'error'; + const WARNING = 'warning'; + const NOTICE = 'notice'; + const INFO = 'info'; + const DEBUG = 'debug'; +} + +namespace Symfony\Component\Debug; + +$dir = __DIR__.'/../../../'; +require $dir.'ErrorHandler.php'; +require $dir.'Exception/FatalErrorException.php'; +require $dir.'Exception/UndefinedFunctionException.php'; +require $dir.'FatalErrorHandler/FatalErrorHandlerInterface.php'; +require $dir.'FatalErrorHandler/ClassNotFoundFatalErrorHandler.php'; +require $dir.'FatalErrorHandler/UndefinedFunctionFatalErrorHandler.php'; +require $dir.'FatalErrorHandler/UndefinedMethodFatalErrorHandler.php'; + +function bar() +{ + foo(); +} + +function foo() +{ + notexist(); +} + +$handler = ErrorHandler::register(); +$handler->setExceptionHandler('print_r'); + +if (function_exists('xdebug_disable')) { + xdebug_disable(); +} + +bar(); +?> +--EXPECTF-- +Fatal error: Call to undefined function Symfony\Component\Debug\notexist() in %s on line %d +Symfony\Component\Debug\Exception\UndefinedFunctionException Object +( + [message:protected] => Attempted to call function "notexist" from namespace "Symfony\Component\Debug". + [string:Exception:private] => + [code:protected] => 0 + [file:protected] => %s + [line:protected] => %d + [trace:Exception:private] => Array + ( + [0] => Array + ( +%A [function] => Symfony\Component\Debug\foo +%A [args] => Array + ( + ) + + ) + + [1] => Array + ( +%A [function] => Symfony\Component\Debug\bar +%A [args] => Array + ( + ) + + ) +%A + ) + + [previous:Exception:private] => + [severity:protected] => 1 +) |