mirror of
https://github.com/php/php-src.git
synced 2024-11-29 04:46:07 +08:00
Remove superfluous SKIPIF sections in Reflection tests
This commit is contained in:
parent
c6c9e71a5b
commit
a920db8f13
@ -1,7 +1,5 @@
|
||||
--TEST--
|
||||
ReflectionMethod::__toString() tests (overriden method)
|
||||
--SKIPIF--
|
||||
<?php extension_loaded('reflection') or die('skip'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
class Foo {
|
||||
@ -15,7 +13,7 @@ class Bar extends Foo {
|
||||
$m = new ReflectionMethod("Bar::func");
|
||||
echo $m;
|
||||
?>
|
||||
--EXPECTF--
|
||||
--EXPECTF--
|
||||
Method [ <user, overwrites Foo, prototype Foo> public method func ] {
|
||||
@@ %s010.php 7 - 8
|
||||
}
|
||||
|
@ -1,12 +1,10 @@
|
||||
--TEST--
|
||||
ReflectionExtension::getClasses()
|
||||
--SKIPIF--
|
||||
<?php extension_loaded('reflection') or die('skip'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
$ext = new ReflectionExtension("reflection");
|
||||
$classes = $ext->getClasses();
|
||||
echo $classes["ReflectionException"]->getName();
|
||||
?>
|
||||
--EXPECT--
|
||||
--EXPECT--
|
||||
ReflectionException
|
||||
|
@ -1,7 +1,5 @@
|
||||
--TEST--
|
||||
ReflectionClass::getDefaultProperties()
|
||||
--SKIPIF--
|
||||
<?php extension_loaded('reflection') or die('skip'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
class Foo {
|
||||
@ -11,6 +9,5 @@ $class = new ReflectionClass("Foo");
|
||||
$props = $class->getDefaultProperties();
|
||||
echo $props["test"];
|
||||
?>
|
||||
--EXPECT--
|
||||
--EXPECT--
|
||||
ok
|
||||
|
||||
|
@ -1,13 +1,10 @@
|
||||
--TEST--
|
||||
ReflectionExtension::getFunctions()
|
||||
--SKIPIF--
|
||||
<?php extension_loaded('reflection') or die('skip'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
$ext = new ReflectionExtension("standard");
|
||||
$funcs = $ext->getFunctions();
|
||||
echo $funcs["sleep"]->getName();
|
||||
?>
|
||||
--EXPECT--
|
||||
--EXPECT--
|
||||
sleep
|
||||
|
||||
|
@ -1,13 +1,10 @@
|
||||
--TEST--
|
||||
ReflectionExtension::getConstants()
|
||||
--SKIPIF--
|
||||
<?php extension_loaded('reflection') or die('skip'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
$ext = new ReflectionExtension("standard");
|
||||
$consts = $ext->getConstants();
|
||||
var_dump($consts["CONNECTION_NORMAL"]);
|
||||
?>
|
||||
--EXPECT--
|
||||
--EXPECT--
|
||||
int(0)
|
||||
|
||||
|
@ -1,7 +1,5 @@
|
||||
--TEST--
|
||||
ReflectionExtension::getINIEntries()
|
||||
--SKIPIF--
|
||||
<?php extension_loaded('reflection') or die('skip'); ?>
|
||||
--INI--
|
||||
user_agent=php
|
||||
--FILE--
|
||||
@ -10,6 +8,5 @@ $ext = new ReflectionExtension("standard");
|
||||
$inis = $ext->getINIEntries();
|
||||
var_dump($inis["user_agent"]);
|
||||
?>
|
||||
--EXPECT--
|
||||
--EXPECT--
|
||||
string(3) "php"
|
||||
|
||||
|
@ -2,7 +2,6 @@
|
||||
ReflectionExtension::getDependencies()
|
||||
--SKIPIF--
|
||||
<?php
|
||||
extension_loaded('reflection') or die('skip');
|
||||
if (!extension_loaded("xml")) {
|
||||
die('skip xml extension not available');
|
||||
}
|
||||
@ -13,7 +12,7 @@ $ext = new ReflectionExtension("xml");
|
||||
$deps = $ext->getDependencies();
|
||||
var_dump($deps);
|
||||
?>
|
||||
--EXPECT--
|
||||
--EXPECT--
|
||||
array(1) {
|
||||
["libxml"]=>
|
||||
string(8) "Required"
|
||||
|
@ -1,7 +1,5 @@
|
||||
--TEST--
|
||||
ReflectionClass::__toString() (constants)
|
||||
--SKIPIF--
|
||||
<?php extension_loaded('reflection') or die('skip'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
class Foo {
|
||||
@ -30,4 +28,3 @@ Class [ <user> class Foo ] {
|
||||
- Methods [0] {
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,12 +1,10 @@
|
||||
--TEST--
|
||||
Reflection::getModifierNames
|
||||
--SKIPIF--
|
||||
<?php extension_loaded('reflection') or die('skip'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
var_dump(Reflection::getModifierNames(ReflectionMethod::IS_FINAL | ReflectionMethod::IS_PROTECTED));
|
||||
?>
|
||||
--EXPECT--
|
||||
--EXPECT--
|
||||
array(2) {
|
||||
[0]=>
|
||||
string(5) "final"
|
||||
|
@ -1,11 +1,9 @@
|
||||
--TEST--
|
||||
ReflectionFunction::getExtensionName
|
||||
--SKIPIF--
|
||||
<?php extension_loaded('reflection') or die('skip'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
$f = new ReflectionFunction("sleep");
|
||||
var_dump($f->getExtensionName());
|
||||
?>
|
||||
--EXPECT--
|
||||
--EXPECT--
|
||||
string(8) "standard"
|
||||
|
@ -1,7 +1,5 @@
|
||||
--TEST--
|
||||
ReflectionObject::hasProperty
|
||||
--SKIPIF--
|
||||
<?php extension_loaded('reflection') or die('skip'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
class Foo {
|
||||
@ -20,7 +18,7 @@ var_dump($obj->hasProperty("p2"));
|
||||
var_dump($obj->hasProperty("p3"));
|
||||
var_dump($obj->hasProperty("p4"));
|
||||
?>
|
||||
--EXPECT--
|
||||
--EXPECT--
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
|
@ -1,7 +1,5 @@
|
||||
--TEST--
|
||||
ReflectionClass::hasConstant
|
||||
--SKIPIF--
|
||||
<?php extension_loaded('reflection') or die('skip'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
class Foo {
|
||||
@ -11,6 +9,6 @@ $class = new ReflectionClass("Foo");
|
||||
var_dump($class->hasConstant("c1"));
|
||||
var_dump($class->hasConstant("c2"));
|
||||
?>
|
||||
--EXPECT--
|
||||
--EXPECT--
|
||||
bool(true)
|
||||
bool(false)
|
||||
|
@ -1,7 +1,5 @@
|
||||
--TEST--
|
||||
ReflectionClass::getConstant
|
||||
--SKIPIF--
|
||||
<?php extension_loaded('reflection') or die('skip'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
class Foo {
|
||||
@ -11,6 +9,6 @@ $class = new ReflectionClass("Foo");
|
||||
var_dump($class->getConstant("c1"));
|
||||
var_dump($class->getConstant("c2"));
|
||||
?>
|
||||
--EXPECT--
|
||||
--EXPECT--
|
||||
int(1)
|
||||
bool(false)
|
||||
|
@ -1,7 +1,5 @@
|
||||
--TEST--
|
||||
ReflectionClass::getDefaultProperties (filtering parent privates)
|
||||
--SKIPIF--
|
||||
<?php extension_loaded('reflection') or die('skip'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
class C1 {
|
||||
@ -17,7 +15,7 @@ class C2 extends C1 {
|
||||
$class = new ReflectionClass("C2");
|
||||
var_dump($class->getDefaultProperties());
|
||||
?>
|
||||
--EXPECT--
|
||||
--EXPECT--
|
||||
array(5) {
|
||||
["p4"]=>
|
||||
int(4)
|
||||
|
@ -1,7 +1,5 @@
|
||||
--TEST--
|
||||
ReflectionObject::__toString (filtering privates/protected dynamic properties)
|
||||
--SKIPIF--
|
||||
<?php extension_loaded('reflection') or die('skip'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
class C1 {
|
||||
@ -17,7 +15,7 @@ $x->p3 = 5;
|
||||
$obj = new ReflectionObject($x);
|
||||
echo $obj;
|
||||
?>
|
||||
--EXPECTF--
|
||||
--EXPECTF--
|
||||
Object of class [ <user> class C1 ] {
|
||||
@@ %s024.php 2-6
|
||||
|
||||
|
@ -1,7 +1,5 @@
|
||||
--TEST--
|
||||
ReflectionFunction basic tests
|
||||
--SKIPIF--
|
||||
<?php extension_loaded('reflection') or die('skip'); ?>
|
||||
--INI--
|
||||
opcache.save_comments=1
|
||||
--FILE--
|
||||
@ -49,7 +47,7 @@ var_dump($func->getNumberOfRequiredParameters());
|
||||
echo "Done\n";
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
--EXPECTF--
|
||||
/**
|
||||
hoho
|
||||
*/
|
||||
|
@ -3,14 +3,11 @@ Reflection class can not be cloned
|
||||
--CREDITS--
|
||||
Stefan Koopmanschap <stefan@phpgg.nl>
|
||||
TestFest PHP|Tek
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('reflection')) print 'skip';
|
||||
?>
|
||||
--FILE--
|
||||
--FILE--
|
||||
<?php
|
||||
$rc = new ReflectionClass("stdClass");
|
||||
$rc2 = clone($rc);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Uncaught Error: Trying to clone an uncloneable object of class ReflectionClass in %s:%d
|
||||
Stack trace:
|
||||
|
@ -2,7 +2,6 @@
|
||||
ReflectionExtension::getFunctions() ##6218 zend_register_functions breaks reflection
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('reflection')) print 'skip missing reflection extension';
|
||||
if (PHP_SAPI != "cli") die("skip CLI only test");
|
||||
if (!function_exists("dl")) die("skip need dl");
|
||||
?>
|
||||
|
@ -1,10 +1,6 @@
|
||||
--TEST--
|
||||
Reflection::getClosureScopeClass()
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('reflection')) print 'skip';
|
||||
?>
|
||||
--FILE--
|
||||
--FILE--
|
||||
<?php
|
||||
$closure = function($param) { return "this is a closure"; };
|
||||
$rf = new ReflectionFunction($closure);
|
||||
@ -20,6 +16,7 @@ $closure = A::getClosure();
|
||||
$rf = new ReflectionFunction($closure);
|
||||
var_dump($rf->getClosureScopeClass());
|
||||
echo "Done!\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
NULL
|
||||
object(ReflectionClass)#%d (1) {
|
||||
|
@ -1,15 +1,12 @@
|
||||
--TEST--
|
||||
Reflection::getClosureThis()
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('reflection')) print 'skip';
|
||||
?>
|
||||
--FILE--
|
||||
--FILE--
|
||||
<?php
|
||||
$closure = function($param) { return "this is a closure"; };
|
||||
$rf = new ReflectionFunction($closure);
|
||||
var_dump($rf->getClosureThis());
|
||||
echo "Done!\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
NULL
|
||||
Done!
|
||||
|
@ -3,14 +3,11 @@ Reflection::isClosure
|
||||
--CREDITS--
|
||||
Stefan Koopmanschap <stefan@phpgg.nl>
|
||||
TestFest PHP|Tek
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('reflection')) print 'skip';
|
||||
?>
|
||||
--FILE--
|
||||
--FILE--
|
||||
<?php
|
||||
$closure = function($param) { return "this is a closure"; };
|
||||
$rc = new ReflectionFunction($closure);
|
||||
var_dump($rc->isClosure());
|
||||
?>
|
||||
--EXPECTF--
|
||||
bool(true)
|
||||
|
@ -3,15 +3,12 @@ ReflectionFunction::isDisabled
|
||||
--CREDITS--
|
||||
Stefan Koopmanschap <stefan@phpgg.nl>
|
||||
TestFest PHP|Tek
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('reflection')) print 'skip';
|
||||
?>
|
||||
--INI--
|
||||
disable_functions=is_file
|
||||
--FILE--
|
||||
--FILE--
|
||||
<?php
|
||||
$rc = new ReflectionFunction('is_file');
|
||||
var_dump($rc->isDisabled());
|
||||
?>
|
||||
--EXPECTF--
|
||||
bool(true)
|
||||
|
@ -1,10 +1,6 @@
|
||||
--TEST--
|
||||
Reflection::getClosureThis()
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('reflection')) print 'skip';
|
||||
?>
|
||||
--FILE--
|
||||
--FILE--
|
||||
<?php
|
||||
class StaticExample
|
||||
{
|
||||
@ -42,6 +38,7 @@ $rf = new ReflectionFunction($closure);
|
||||
var_dump($rf->getClosureThis());
|
||||
|
||||
echo "Done!\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
NULL
|
||||
object(Example)#%d (1) {
|
||||
|
@ -1,11 +1,9 @@
|
||||
--TEST--
|
||||
ReflectionMethod::getDocComment() uses left over doc comment from previous scanner run
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded('tokenizer')) die('skip tokenizer extension not loaded'); ?>
|
||||
--INI--
|
||||
opcache.save_comments=1
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('reflection') || !extension_loaded('tokenizer')) print 'skip missing reflection of tokernizer extension';
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user