]> granicus.if.org Git - php/commitdiff
Remove obsolete version checks from tests
authorNikita Popov <nikita.ppv@gmail.com>
Wed, 1 Feb 2017 23:57:40 +0000 (00:57 +0100)
committerNikita Popov <nikita.ppv@gmail.com>
Wed, 1 Feb 2017 23:58:04 +0000 (00:58 +0100)
15 files changed:
Zend/tests/return_types/reflection001.phpt
Zend/tests/unset_cv07.phpt [deleted file]
ext/posix/tests/posix_access.phpt [deleted file]
ext/posix/tests/posix_access_error_modes.phpt [deleted file]
ext/posix/tests/posix_access_error_wrongparams.phpt [deleted file]
ext/posix/tests/posix_access_safemode.phpt [deleted file]
ext/posix/tests/posix_mkfifo_safemode.phpt [deleted file]
ext/reflection/tests/ReflectionFunction_getClosureScopeClass.phpt
ext/reflection/tests/ReflectionFunction_getClosureThis.phpt
ext/reflection/tests/ReflectionFunction_isClosure_basic.phpt
ext/reflection/tests/ReflectionMethod_getClosureThis.phpt
ext/standard/tests/general_functions/import_request.phpt [deleted file]
ext/standard/tests/general_functions/import_request1.phpt [deleted file]
ext/standard/tests/general_functions/import_request2.phpt [deleted file]
ext/standard/tests/general_functions/import_request3.phpt [deleted file]

index 6492ee1906efdabff980d297d2fbd6684c6bd567..c95f7292b569d31b04cf7fac6933d2dda89409d1 100644 (file)
@@ -1,12 +1,9 @@
 --TEST--
 Return type and Reflection::export()
-
 --SKIPIF--
 <?php
-if (!extension_loaded('reflection') || !defined('PHP_VERSION_ID') || PHP_VERSION_ID < 70000) {
-    print 'skip';
-}
-
+if (!extension_loaded('reflection')) print 'skip';
+?>
 --FILE--
 <?php
 
diff --git a/Zend/tests/unset_cv07.phpt b/Zend/tests/unset_cv07.phpt
deleted file mode 100644 (file)
index 3f893ca..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
---TEST--
-unset() CV 7 (indirect unset() of global variable in import_request_variables())
---SKIPIF--
-<?php if(PHP_VERSION_ID >= 50399){ die('skip not needed anymore without register_globals'); } ?>
---GET--
-x=2
---FILE--
-<?php
-$_x = "1\n";
-echo $_x;
-import_request_variables("g","_");
-echo $_x;
-echo "\nok\n";
-?>
---EXPECTF--
-1
-2
-ok
diff --git a/ext/posix/tests/posix_access.phpt b/ext/posix/tests/posix_access.phpt
deleted file mode 100644 (file)
index 47b5e15..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
---TEST--
-Test posix_access() function test
---DESCRIPTION--
-checks for existence, read-access, write-access, execute-access
---CREDITS--
-Moritz Neuhaeuser, info@xcompile.net
-PHP Testfest Berlin 2009-05-10
---SKIPIF--
-<?php
-if (!extension_loaded('posix')) {
-    die('SKIP The posix extension is not loaded.');
-}
-if (posix_geteuid() == 0) {
-    die('SKIP Cannot run test as root.');
-}
-if (PHP_VERSION_ID < 503099) {
-    die('SKIP Safe mode is no longer available.');
-}
-?>
---FILE--
-<?php
-$filename = dirname(__FILE__) . '/foo.test';
-$fp = fopen($filename,"w");
-fwrite($fp,"foo");
-fclose($fp);
-
-chmod ($filename, 0000);
-var_dump(posix_access($filename, POSIX_F_OK));
-
-chmod ($filename, 0400);
-var_dump(posix_access($filename, POSIX_R_OK));
-
-chmod ($filename, 0600);
-var_dump(posix_access($filename, POSIX_W_OK));
-
-chmod ($filename, 0700);
-var_dump(posix_access($filename, POSIX_X_OK));
-?>
-===DONE===
---CLEAN--
-<?php
-$filename = dirname(__FILE__) . '/foo.test';
-chmod ($filename, 0700);
-unlink($filename);
-?>
---EXPECTF--
-Deprecated: Directive 'safe_mode' is deprecated in PHP 5.3 and greater in %s on line %d
-bool(true)
-bool(true)
-bool(true)
-bool(true)
-===DONE===
diff --git a/ext/posix/tests/posix_access_error_modes.phpt b/ext/posix/tests/posix_access_error_modes.phpt
deleted file mode 100644 (file)
index fb04e34..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
---TEST--
-Test posix_access() function test error conditions
---DESCRIPTION--
-checks if posix_access() failes for wrong permissions
---CREDITS--
-Moritz Neuhaeuser, info@xcompile.net
-PHP Testfest Berlin 2009-05-10
---SKIPIF--
-<?php
-if (!extension_loaded('posix')) {
-    die('SKIP The posix extension is not loaded.');
-}
-if (posix_geteuid() == 0) {
-    die('SKIP Cannot run test as root.');
-}
-if (PHP_VERSION_ID < 503099) {
-    die('SKIP Safe mode is no longer available.');
-}
-?>
---FILE--
-<?php
-$filename = dirname(__FILE__) . '/foo.test';
-var_dump(posix_access($filename, POSIX_F_OK));
-$fp = fopen($filename,"w");
-fwrite($fp,"foo");
-fclose($fp);
-
-chmod ($filename, 0000);
-var_dump(posix_access($filename, POSIX_R_OK));
-var_dump(posix_access($filename, POSIX_W_OK));
-var_dump(posix_access($filename, POSIX_X_OK));
-?>
-===DONE===
---CLEAN--
-<?php
-$filename = dirname(__FILE__) . '/foo.test';
-chmod ($filename, 0700);
-unlink($filename);
-?>
---EXPECTF--
-WDeprecated: Directive 'safe_mode' is deprecated in PHP 5.3 and greater in Unknown on line %d
-bool(false)
-bool(false)
-bool(false)
-bool(false)
-===DONE===
diff --git a/ext/posix/tests/posix_access_error_wrongparams.phpt b/ext/posix/tests/posix_access_error_wrongparams.phpt
deleted file mode 100644 (file)
index dcab33c..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
---TEST--
-Test posix_access() function : parameter validation 
---DESCRIPTION--
-cases: no params, wrong param1, wrong param2, null directory, wrong directory,
---CREDITS--
-Moritz Neuhaeuser, info@xcompile.net
-PHP Testfest Berlin 2009-05-10
---SKIPIF--
-<?php
-if (!extension_loaded('posix')) {
-    die('SKIP The posix extension is not loaded.');
-}
-if (posix_geteuid() == 0) {
-    die('SKIP Cannot run test as root.');
-}
-if (PHP_VERSION_ID < 503099) {
-    die('SKIP Safe mode is no longer available.');
-}
-?>
---FILE--
-<?php
-
-var_dump( posix_access() );
-var_dump( posix_access(array()) );
-var_dump( posix_access('foo',array()) );
-var_dump( posix_access(null) );
-
-var_dump(posix_access('./foobar'));
-?>
-===DONE===
---EXPECTF--
-Deprecated: Directive 'safe_mode' is deprecated in PHP 5.3 and greater in Unknown on line 0
-
-Warning: posix_access() expects at least 1 parameter, 0 given in %s on line %d
-bool(false)
-
-Warning: posix_access() expects parameter 1 to be string, array given in %s on line %d
-bool(false)
-
-Warning: posix_access() expects parameter 2 to be integer, array given in %s on line %d
-bool(false)
-bool(false)
-bool(false)
-===DONE===
diff --git a/ext/posix/tests/posix_access_safemode.phpt b/ext/posix/tests/posix_access_safemode.phpt
deleted file mode 100644 (file)
index b726b4f..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
---TEST--
-Test posix_access() with safe_mode enabled.
---CREDITS--
-Till Klampaeckel, till@php.net
-TestFest Berlin 2009
---SKIPIF--
-<?php
-if (!extension_loaded('posix')) {
-    die('SKIP The posix extension is not loaded.');
-}
-if (posix_geteuid() == 0) {
-    die('SKIP Cannot run test as root.');
-}
-if (PHP_VERSION_ID < 503099) {
-    die('SKIP Safe mode is no longer available.');
-}
---FILE--
-<?php
-var_dump(posix_access('/tmp', POSIX_W_OK));
-?>
-===DONE===
---EXPECTF--
-Deprecated: Directive 'safe_mode' is deprecated in PHP 5.3 and greater in %s on line %d
-bool(false)
-===DONE===
diff --git a/ext/posix/tests/posix_mkfifo_safemode.phpt b/ext/posix/tests/posix_mkfifo_safemode.phpt
deleted file mode 100644 (file)
index 1126c00..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
---TEST--
-Test posix_mkfifo() with safe_mode.
---DESCRIPTION--
-The test attempts to enable safe_mode, catches all the relevant E_WARNING's and tries to create a fifo in /tmp.
-
-The first attempt (writing to /tmp) should effectively fail because /tmp is owned by root.
-
-The second attempt (writing to a local created file) works.
---CREDITS--
-Till Klampaeckel, till@php.net
-TestFest Berlin 2009
---SKIPIF--
-<?php
-if (!extension_loaded('posix')) {
-    die('SKIP The posix extension is not loaded.');
-}
-if (posix_geteuid() == 0) {
-    die('SKIP Cannot run test as root.');
-}
-if (PHP_VERSION_ID < 503099) {
-    die('SKIP Safe mode is no longer available.');
-}
-?>
---FILE--
-<?php
-var_dump(posix_mkfifo('/tmp/foobar', 0644));
-
-$dir = dirname(__FILE__) . '/foo';
-mkdir ($dir);
-var_dump(posix_mkfifo($dir . '/bar', 0644));
-?>
-===DONE===
---CLEAN--
-<?php
-$dir = dirname(__FILE__) . '/foo';
-unlink($dir . '/bar');
-rmdir($dir);
-?>
---EXPECTF--
-Deprecated: Directive 'safe_mode' is deprecated in PHP 5.3 and greater in %s on line %d
-
-Warning: posix_mkfifo(): SAFE MODE Restriction in effect.  The script whose uid is %d is not allowed to access /tmp owned by uid %d in %s on line %d
-bool(false)
-bool(true)
-===DONE===
index f725dfd08893b64044a1e4256a5ccfebccafc43f..e32790c92371560e2a49d79f8b9d5e7e6711d685 100644 (file)
@@ -2,9 +2,7 @@
 Reflection::getClosureScopeClass()
 --SKIPIF--
 <?php
-if (!extension_loaded('reflection') || !defined('PHP_VERSION_ID') || PHP_VERSION_ID < 50399) {
-  print 'skip';
-}
+if (!extension_loaded('reflection')) print 'skip';
 ?>
 --FILE-- 
 <?php
index 776bfafee08fc28a8f4973f9f55ba56042150408..479502579829746fc8c0db1c27adadbac2cb6591 100644 (file)
@@ -2,9 +2,7 @@
 Reflection::getClosureThis()
 --SKIPIF--
 <?php
-if (!extension_loaded('reflection') || !defined('PHP_VERSION_ID') || PHP_VERSION_ID < 50300) {
-  print 'skip';
-}
+if (!extension_loaded('reflection')) print 'skip';
 ?>
 --FILE-- 
 <?php
index 368464e13033b8f5ae47b51fd38c96005548509d..df101fcd3ee4a169eb0a52f24f458ab725b9d9e2 100644 (file)
@@ -5,9 +5,7 @@ Stefan Koopmanschap <stefan@phpgg.nl>
 TestFest PHP|Tek
 --SKIPIF--
 <?php
-if (!extension_loaded('reflection') || !defined('PHP_VERSION_ID') || PHP_VERSION_ID < 50300) {
-  print 'skip';
-}
+if (!extension_loaded('reflection')) print 'skip';
 ?>
 --FILE-- 
 <?php
index 58c09994cf0b225d89e26d8b104755ff07db9430..536f40c2e1c424700c8aac8e09303384903a604d 100644 (file)
@@ -2,9 +2,7 @@
 Reflection::getClosureThis()
 --SKIPIF--
 <?php
-if (!extension_loaded('reflection') || !defined('PHP_VERSION_ID') || PHP_VERSION_ID < 50300) {
-  print 'skip';
-}
+if (!extension_loaded('reflection')) print 'skip';
 ?>
 --FILE-- 
 <?php
diff --git a/ext/standard/tests/general_functions/import_request.phpt b/ext/standard/tests/general_functions/import_request.phpt
deleted file mode 100644 (file)
index 4a791c7..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
---TEST--
-import_request_variables() tests
---SKIPIF--
-<?php if(PHP_VERSION_ID >= 50399){ die('skip not needed anymore without register_globals'); } ?>
---GET--
-a=1&b=heh&c=3&d[]=5&GLOBALS=test&1=hm
---POST--
-ap=25&bp=test&cp=blah3&dp[]=ar
---FILE--
-<?php
-
-var_dump(import_request_variables());
-var_dump(import_request_variables(""));
-var_dump(import_request_variables("", ""));
-
-var_dump(import_request_variables("g", ""));
-var_dump($a, $b, $c, $ap);
-
-var_dump(import_request_variables("g", "g_"));
-var_dump($g_a, $g_b, $g_c, $g_ap, $g_1);
-
-var_dump(import_request_variables("GP", "i_"));
-var_dump($i_a, $i_b, $i_c, $i_ap, $i_bp, $i_cp, $i_dp);
-
-var_dump(import_request_variables("gGg", "r_"));
-var_dump($r_a, $r_b, $r_c, $r_ap);
-
-echo "Done\n";
-?>
---EXPECTF--    
-Warning: import_request_variables() expects at least 1 parameter, 0 given in %s on line %d
-NULL
-bool(false)
-
-Notice: import_request_variables(): No prefix specified - possible security hazard in %s on line %d
-bool(false)
-
-Notice: import_request_variables(): No prefix specified - possible security hazard in %s on line %d
-
-Warning: import_request_variables(): Attempted GLOBALS variable overwrite in %s on line %d
-
-Warning: import_request_variables(): Numeric key detected - possible security hazard in %s on line %d
-bool(true)
-
-Notice: Undefined variable: ap in %s on line %d
-string(1) "1"
-string(3) "heh"
-string(1) "3"
-NULL
-bool(true)
-
-Notice: Undefined variable: g_ap in %s on line %d
-string(1) "1"
-string(3) "heh"
-string(1) "3"
-NULL
-string(2) "hm"
-bool(true)
-string(1) "1"
-string(3) "heh"
-string(1) "3"
-string(2) "25"
-string(4) "test"
-string(5) "blah3"
-array(1) {
-  [0]=>
-  string(2) "ar"
-}
-bool(true)
-
-Notice: Undefined variable: r_ap in %s on line %d
-string(1) "1"
-string(3) "heh"
-string(1) "3"
-NULL
-Done
diff --git a/ext/standard/tests/general_functions/import_request1.phpt b/ext/standard/tests/general_functions/import_request1.phpt
deleted file mode 100644 (file)
index f592088..0000000
+++ /dev/null
@@ -1,101 +0,0 @@
---TEST--
-import_request_variables() test (overwrite super-globals)
---SKIPIF--
-<?php if(PHP_VERSION_ID >= 50399){ die('skip not needed anymore without register_globals'); } ?>
---GET--
-GET=0&POST=1&COOKIE=2&FILES=3&REQUEST=4
---POST--
-GET=5&POST=6&COOKIE=7&FILES=8&REQUEST=9
---COOKIE--
-GET=10;POST=11;COOKIE=12;FILES=13;REQUEST=14
---INI--
-variables_order=CGP
---FILE--
-<?php
-
-import_request_variables("gpc", "_");
-var_dump($_GET, $_POST, $_COOKIE, $_FILES, $_REQUEST);
-
-echo "Done\n";
-?>
---EXPECTF--
-Warning: import_request_variables(): Attempted super-global (_GET) variable overwrite in %s on line %d
-
-Warning: import_request_variables(): Attempted super-global (_POST) variable overwrite in %s on line %d
-
-Warning: import_request_variables(): Attempted super-global (_COOKIE) variable overwrite in %s on line %d
-
-Warning: import_request_variables(): Attempted super-global (_FILES) variable overwrite in %s on line %d
-
-Warning: import_request_variables(): Attempted super-global (_REQUEST) variable overwrite in %s on line %d
-
-Warning: import_request_variables(): Attempted super-global (_GET) variable overwrite in %s on line %d
-
-Warning: import_request_variables(): Attempted super-global (_POST) variable overwrite in %s on line %d
-
-Warning: import_request_variables(): Attempted super-global (_COOKIE) variable overwrite in %s on line %d
-
-Warning: import_request_variables(): Attempted super-global (_FILES) variable overwrite in %s on line %d
-
-Warning: import_request_variables(): Attempted super-global (_REQUEST) variable overwrite in %s on line %d
-
-Warning: import_request_variables(): Attempted super-global (_GET) variable overwrite in %s on line %d
-
-Warning: import_request_variables(): Attempted super-global (_POST) variable overwrite in %s on line %d
-
-Warning: import_request_variables(): Attempted super-global (_COOKIE) variable overwrite in %s on line %d
-
-Warning: import_request_variables(): Attempted super-global (_FILES) variable overwrite in %s on line %d
-
-Warning: import_request_variables(): Attempted super-global (_REQUEST) variable overwrite in %s on line %d
-array(5) {
-  ["GET"]=>
-  string(1) "0"
-  ["POST"]=>
-  string(1) "1"
-  ["COOKIE"]=>
-  string(1) "2"
-  ["FILES"]=>
-  string(1) "3"
-  ["REQUEST"]=>
-  string(1) "4"
-}
-array(5) {
-  ["GET"]=>
-  string(1) "5"
-  ["POST"]=>
-  string(1) "6"
-  ["COOKIE"]=>
-  string(1) "7"
-  ["FILES"]=>
-  string(1) "8"
-  ["REQUEST"]=>
-  string(1) "9"
-}
-array(5) {
-  ["GET"]=>
-  string(2) "10"
-  ["POST"]=>
-  string(2) "11"
-  ["COOKIE"]=>
-  string(2) "12"
-  ["FILES"]=>
-  string(2) "13"
-  ["REQUEST"]=>
-  string(2) "14"
-}
-array(0) {
-}
-array(5) {
-  ["GET"]=>
-  string(1) "5"
-  ["POST"]=>
-  string(1) "6"
-  ["COOKIE"]=>
-  string(1) "7"
-  ["FILES"]=>
-  string(1) "8"
-  ["REQUEST"]=>
-  string(1) "9"
-}
-Done
diff --git a/ext/standard/tests/general_functions/import_request2.phpt b/ext/standard/tests/general_functions/import_request2.phpt
deleted file mode 100644 (file)
index c290602..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
---TEST--
-import_request_variables() test (numeric keys)
---SKIPIF--
-<?php if(PHP_VERSION_ID >= 50399){ die('skip not needed anymore without register_globals'); } ?>
---GET--
-1=0&2=1&3=2&4=3&5=4
---POST--
-1=5&2=6&3=7&4=8&5=9
---COOKIE--
-1=10;2=11;3=12;4=13;5=14
---INI--
-variables_order=CGP
---FILE--
-<?php
-
-import_request_variables("gpc", "_");
-var_dump($_1, $_2, $_3, $_4, $_5);
-
-echo "Done\n";
-?>
---EXPECTF--
-string(2) "10"
-string(2) "11"
-string(2) "12"
-string(2) "13"
-string(2) "14"
-Done
diff --git a/ext/standard/tests/general_functions/import_request3.phpt b/ext/standard/tests/general_functions/import_request3.phpt
deleted file mode 100644 (file)
index a8cbf56..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
---TEST--
-import_request_variables() test (numeric keys, different order)
---SKIPIF--
-<?php if(PHP_VERSION_ID >= 50399){ die('skip not needed anymore without register_globals'); } ?>
---GET--
-1=0&2=1&3=2&4=3&5=4
---POST--
-1=5&2=6&3=7&4=8&5=9
---COOKIE--
-1=10;2=11;3=12;4=13;5=14
---INI--
-variables_order=CGP
---FILE--
-<?php
-
-import_request_variables("gcp", "_");
-var_dump($_1, $_2, $_3, $_4, $_5);
-
-echo "Done\n";
-?>
---EXPECTF--
-string(1) "5"
-string(1) "6"
-string(1) "7"
-string(1) "8"
-string(1) "9"
-Done