Remove duplicated tests

This commit is contained in:
Gabriel Caruso 2018-02-20 20:08:09 -03:00 committed by Christoph M. Becker
parent d393199e13
commit e1cc4863d9
21 changed files with 4 additions and 713 deletions

View file

@ -1,26 +0,0 @@
--TEST--
Bug #55137 (Changing trait static method visibility)
--FILE--
<?php
trait A {
protected static function foo() { echo "abc\n"; }
private static function bar() { echo "def\n"; }
}
class B {
use A {
A::foo as public;
A::bar as public baz;
}
}
B::foo();
B::baz();
?>
--EXPECT--
abc
def

View file

@ -1,11 +0,0 @@
--TEST--
Bug #72221 (Segmentation fault in stream_get_line / zend_memnstr_ex)
--FILE--
<?php
$fp = fopen("php://memory", "r+");
fwrite($fp, str_repeat("baad", 1024*1024));
rewind($fp);
stream_get_line($fp, 1024*1024*2, "aaaa");
echo "Done\n";
--EXPECT--
Done

View file

@ -1,18 +0,0 @@
--TEST--
Testing instantiation using namespace:: prefix
--FILE--
<?php
namespace foo;
class bar {
}
class_alias('foo\bar', 'foo\baz');
var_dump(new namespace\baz);
?>
--EXPECTF--
object(foo\bar)#%d (0) {
}

View file

@ -1,16 +0,0 @@
--TEST--
077: Unknown compile-time constants in namespace
--FILE--
<?php
function foo($a = array(0 => \unknown))
{
}
foo();
--EXPECTF--
Fatal error: Uncaught Error: Undefined constant 'unknown' in %sns_077_%d.php:%d
Stack trace:
#0 %s(%d): foo()
#1 {main}
thrown in %sns_077_%d.php on line %d

View file

@ -1,60 +0,0 @@
--TEST--
Test gmdate() function : usage variation - Passing Year format options to format argument.
--FILE--
<?php
/* Prototype : string gmdate(string format [, long timestamp])
* Description: Format a GMT date/time
* Source code: ext/date/php_date.c
* Alias to functions:
*/
echo "*** Testing gmdate() : usage variation ***\n";
// Initialise all required variables
date_default_timezone_set('UTC');
$timestamp = mktime(8, 8, 8, 8, 8, 2008);
$timestamp_non_leap_year = mktime(8, 8, 8, 8, 8, 2007);
echo "\n-- Testing gmdate() function with checking non leap year using Leap Year format --\n";
var_dump( gmdate('L', $timestamp_non_leap_year) );
echo "\n-- Testing gmdate() function with checking leap year using Leap Year format --\n";
var_dump( gmdate('L') );
var_dump( gmdate('L', $timestamp) );
echo "\n-- Testing gmdate() function with ISO-8601 year number format --\n";
var_dump( gmdate('o') );
var_dump( gmdate('o', $timestamp) );
echo "\n-- Testing gmdate() function with full numeric representation of year format --\n";
var_dump( gmdate('Y') );
var_dump( gmdate('Y', $timestamp) );
echo "\n-- Testing gmdate() function with 2 digit representation year format --\n";
var_dump( gmdate('y') );
var_dump( gmdate('y', $timestamp) );
?>
===DONE===
--EXPECTF--
*** Testing gmdate() : usage variation ***
-- Testing gmdate() function with checking non leap year using Leap Year format --
string(1) "0"
-- Testing gmdate() function with checking leap year using Leap Year format --
string(1) "%d"
string(1) "1"
-- Testing gmdate() function with ISO-8601 year number format --
string(4) "%d"
string(4) "2008"
-- Testing gmdate() function with full numeric representation of year format --
string(4) "%d"
string(4) "2008"
-- Testing gmdate() function with 2 digit representation year format --
string(2) "%d"
string(2) "08"
===DONE===

View file

@ -1,17 +1,17 @@
--TEST--
Testing error on non-long parameter 4 of imagestring() of GD library
Testing error on non-long parameter 4 of imagestringup() of GD library
--CREDITS--
Rafael Dohms <rdohms [at] gmail [dot] com>
#testfest PHPSP on 2009-06-20
--SKIPIF--
<?php
<?php
if (!extension_loaded("gd")) die("skip GD not present");
?>
--FILE--
<?php
$image = imagecreatetruecolor(180, 30);
$result = imagestring($image, 1, 5, 'string', 'String', 1);
$result = imagestringup($image, 1, 5, 'string', 'String', 1);
?>
--EXPECTF--
Warning: imagestring() expects parameter 4 to be int, %s given in %s on line %d
Warning: imagestringup() expects parameter 4 to be int, %s given in %s on line %d

View file

@ -1,44 +0,0 @@
--TEST--
mb_ereg() returning matches
--SKIPIF--
<?php
if (!extension_loaded('mbstring')) die('skip mbstring not enabled');
if (!function_exists("mb_ereg")) print "skip mb_ereg() not available";
?>
--FILE--
<?php
$a = -1; $b = -1; $c = -1;
mbereg($a, $b, $c);
var_dump($a, $b, $c);
mberegi($a, $b, $c);
var_dump($a, $b, $c);
mbereg_search_init($a, $b, $c);
var_dump($a, $b, $c);
echo "Done\n";
?>
--EXPECTF--
int(-1)
int(-1)
array(1) {
[0]=>
string(2) "-1"
}
int(-1)
int(-1)
array(1) {
[0]=>
string(2) "-1"
}
Warning: mbereg_search_init() expects parameter 3 to be string, array given in %s on line %d
int(-1)
int(-1)
array(1) {
[0]=>
string(2) "-1"
}
Done

View file

@ -1,20 +0,0 @@
--TEST--
mb_eregi() and invalid arguments
--SKIPIF--
<?php
if (!extension_loaded('mbstring')) die('skip mbstring not enabled');
if (!function_exists("mb_eregi")) print "skip mb_eregi() not available";
?>
--FILE--
<?php
mb_regex_encoding('utf-8');
var_dump(mb_eregi('z', 'XYZ'));
var_dump(mb_eregi('xyzp', 'XYZ'));
var_dump(mb_eregi('ö', 'Öäü'));
?>
--EXPECT--
int(1)
bool(false)
int(1)

View file

@ -1,53 +0,0 @@
--TEST--
oci8.default_prefetch ini option
--SKIPIF--
<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?>
--INI--
oci8.default_prefetch=20
--FILE--
<?php
require(dirname(__FILE__)."/connect.inc");
// Initialize
$stmtarray = array(
"drop table default_prefetch_tab",
"create table default_prefetch_tab (id number, value number)",
"insert into default_prefetch_tab (id, value) values (1,1)",
"insert into default_prefetch_tab (id, value) values (1,1)",
"insert into default_prefetch_tab (id, value) values (1,1)",
);
oci8_test_sql_execute($c, $stmtarray);
// Run Test
$select_sql = "select * from default_prefetch_tab";
if (!($s = oci_parse($c, $select_sql))) {
die("oci_parse(select) failed!\n");
}
if (!oci_execute($s)) {
die("oci_execute(select) failed!\n");
}
var_dump(oci_fetch($s));
var_dump(oci_num_rows($s));
// Cleanup
$stmtarray = array(
"drop table default_prefetch_tab"
);
oci8_test_sql_execute($c, $stmtarray);
echo "Done\n";
?>
--EXPECT--
bool(true)
int(1)
Done

View file

@ -1,94 +0,0 @@
--TEST--
oci_fetch_all()
--SKIPIF--
<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?>
--FILE--
<?php
require(dirname(__FILE__)."/connect.inc");
// Initialize
$stmtarray = array(
"drop table fetch_all_tab",
"create table fetch_all_tab (id number, value number)",
"insert into fetch_all_tab (id, value) values (1,1)",
"insert into fetch_all_tab (id, value) values (1,1)",
"insert into fetch_all_tab (id, value) values (1,1)"
);
oci8_test_sql_execute($c, $stmtarray);
if (!($s = oci_parse($c, "select * from fetch_all_tab"))) {
die("oci_parse(select) failed!\n");
}
/* oci_fetch_all */
if (!oci_execute($s)) {
die("oci_execute(select) failed!\n");
}
var_dump(oci_fetch_all($s, $all));
var_dump($all);
/* ocifetchstatement */
if (!oci_execute($s)) {
die("oci_execute(select) failed!\n");
}
var_dump(ocifetchstatement($s, $all));
var_dump($all);
// Cleanup
$stmtarray = array(
"drop table fetch_all_tab"
);
oci8_test_sql_execute($c, $stmtarray);
echo "Done\n";
?>
--EXPECT--
int(3)
array(2) {
["ID"]=>
array(3) {
[0]=>
string(1) "1"
[1]=>
string(1) "1"
[2]=>
string(1) "1"
}
["VALUE"]=>
array(3) {
[0]=>
string(1) "1"
[1]=>
string(1) "1"
[2]=>
string(1) "1"
}
}
int(3)
array(2) {
["ID"]=>
array(3) {
[0]=>
string(1) "1"
[1]=>
string(1) "1"
[2]=>
string(1) "1"
}
["VALUE"]=>
array(3) {
[0]=>
string(1) "1"
[1]=>
string(1) "1"
[2]=>
string(1) "1"
}
}
Done

View file

@ -1,16 +0,0 @@
--TEST--
$session_array = explode(";", session_encode()); should not segfault
--SKIPIF--
<?php include('skipif.inc'); ?>
--INI--
session.use_cookies=0
session.cache_limiter=
--FILE--
<?php
error_reporting(E_ALL);
$session_array = explode(";", @session_encode());
print "I live\n";
?>
--EXPECT--
I live

View file

@ -1,25 +0,0 @@
--TEST--
redefining SID should not cause warnings
--SKIPIF--
<?php include('skipif.inc'); ?>
--INI--
session.use_cookies=0
session.use_strict_mode=0
session.cache_limiter=
session.serialize_handler=php
session.save_handler=files
--FILE--
<?php
error_reporting(E_ALL);
session_id("abtest");
session_start();
session_destroy();
session_id("abtest2");
session_start();
session_destroy();
print "I live\n";
?>
--EXPECT--
I live

View file

@ -1,17 +0,0 @@
--TEST--
SPL: FixedArray: var_dump
--FILE--
<?php
$a = new SplFixedArray(2);
$a[0] = "foo";
var_dump(empty($a[0]), empty($a[1]), $a);
?>
--EXPECTF--
bool(false)
bool(true)
object(SplFixedArray)#%d (2) {
[0]=>
string(3) "foo"
[1]=>
NULL
}

View file

@ -1,18 +0,0 @@
--TEST--
SPL: EmptyIterator
--FILE--
<?php
echo "===EmptyIterator===\n";
foreach(new LimitIterator(new EmptyIterator(), 0, 3) as $key => $val)
{
echo "$key=>$val\n";
}
?>
===DONE===
<?php exit(0);
--EXPECT--
===EmptyIterator===
===DONE===

View file

@ -1,33 +0,0 @@
--TEST--
SPL: NoRewindIterator
--FILE--
<?php
echo "===Current===\n";
$it = new NoRewindIterator(new ArrayIterator(array(0 => 'A', 1 => 'B', 2 => 'C')));
echo $it->key() . '=>' . $it->current() . "\n";
echo "===Next===\n";
$it->next();
echo "===Foreach===\n";
foreach($it as $key=>$val)
{
echo "$key=>$val\n";
}
?>
===DONE===
<?php exit(0); ?>
--EXPECT--
===Current===
0=>A
===Next===
===Foreach===
1=>B
2=>C
===DONE===

View file

@ -1,66 +0,0 @@
--TEST--
SPL: AppendIterator
--FILE--
<?php
echo "===Empty===\n";
$it = new AppendIterator;
foreach($it as $key=>$val)
{
echo "$key=>$val\n";
}
echo "===Append===\n";
$it->append(new ArrayIterator(array(0 => 'A', 1 => 'B')));
foreach($it as $key=>$val)
{
echo "$key=>$val\n";
}
echo "===Rewind===\n";
foreach($it as $key=>$val)
{
echo "$key=>$val\n";
}
echo "===Append===\n";
$it->append(new ArrayIterator(array(2 => 'C', 3 => 'D')));
foreach(new NoRewindIterator($it) as $key=>$val)
{
echo "$key=>$val\n";
}
echo "===Rewind===\n";
foreach($it as $key=>$val)
{
echo "$key=>$val\n";
}
?>
===DONE===
<?php exit(0); ?>
--EXPECT--
===Empty===
===Append===
0=>A
1=>B
===Rewind===
0=>A
1=>B
===Append===
2=>C
3=>D
===Rewind===
0=>A
1=>B
2=>C
3=>D
===DONE===

View file

@ -1,75 +0,0 @@
--TEST--
Test opendir() function : usage variations - Different wildcards
--SKIPIF--
<?php
if (substr(PHP_OS, 0, 3) != 'WIN') {
die("skip Valid only on Windows");
}
?>
--FILE--
<?php
/* Prototype : mixed opendir(string $path[, resource $context])
* Description: Open a directory and return a dir_handle
* Source code: ext/standard/dir.c
*/
/*
* Pass paths containing wildcards to test if opendir() recognises them
*/
echo "*** Testing opendir() : usage variations ***\n";
// create the temporary directories
$file_path = dirname(__FILE__);
$dir_path = $file_path . "/opendir_variation6";
$sub_dir_path = $dir_path . "/sub_dir1";
mkdir($dir_path);
mkdir($sub_dir_path);
// with different wildcard characters
echo "\n-- Wildcard = '*' --\n";
var_dump( opendir($file_path . "/opendir_var*") );
var_dump( opendir($file_path . "/*") );
echo "\n-- Wildcard = '?' --\n";
var_dump( opendir($dir_path . "/sub_dir?") );
var_dump( opendir($dir_path . "/sub?dir1") );
?>
===DONE===
--CLEAN--
<?php
$dir_path = dirname(__FILE__) . "/opendir_variation6";
$sub_dir_path = $dir_path . "/sub_dir1";
rmdir($sub_dir_path);
rmdir($dir_path);
?>
--EXPECTF--
*** Testing opendir() : usage variations ***
-- Wildcard = '*' --
Warning: opendir(%s/opendir_var*,%s/opendir_var*): %s in %s on line %d
Warning: opendir(%s/opendir_var*): failed to open dir: %s in %s on line %d
bool(false)
Warning: opendir(%s/*,%s/*): %s in %s on line %d
Warning: opendir(%s/*): failed to open dir: %s in %s on line %d
bool(false)
-- Wildcard = '?' --
Warning: opendir(%s/opendir_variation6/sub_dir?,%s/opendir_variation6/sub_dir?): %s in %s on line %d
Warning: opendir(%s/opendir_variation6/sub_dir?): failed to open dir: %s in %s on line %d
bool(false)
Warning: opendir(%s/opendir_variation6/sub?dir1,%s/opendir_variation6/sub?dir1): %s in %s on line %d
Warning: opendir(%s/opendir_variation6/sub?dir1): failed to open dir: %s in %s on line %d
bool(false)
===DONE===

View file

@ -1,27 +0,0 @@
--TEST--
Test glob() function: error condition - pattern too long.
--CREDITS--
Dave Kelsey <d_kelsey@uk.ibm.com>
--SKIPIF--
<?php
if(substr(PHP_OS, 0, 3) != "WIN")
die("skip Only valid for Windows");
?>
--FILE--
<?php
/* Prototype: array glob ( string $pattern [, int $flags] );
Description: Find pathnames matching a pattern
*/
echo "*** Testing glob() : error condition - pattern too long. ***\n";
var_dump(glob(str_repeat('x', 3000)));
echo "Done";
?>
--EXPECTF--
*** Testing glob() : error condition - pattern too long. ***
Warning: glob(): Pattern exceeds the maximum allowed length of %d characters in %s on line %d
bool(false)
Done

View file

@ -1,11 +0,0 @@
--TEST--
Location: headers respect the header() response code parameter
--CGI--
--FILE--
<?php
header('Location: http://example.com/', true, 404);
?>
--EXPECTHEADERS--
Status: 404 Not Found
Location: http://example.com/
--EXPECT--

View file

@ -1,42 +0,0 @@
--TEST--
tidy_repair_*() and invalid parameters
--SKIPIF--
<?php if (!extension_loaded("tidy")) print "skip"; ?>
--FILE--
<?php
$l = 1;
$s = "";
$a = array();
tidy_repair_string($s, $l, $l, $l);
tidy_repair_string($s, $s, $s, $s);
tidy_repair_string($l, $l, $l ,$l);
tidy_repair_string($a, $a, $a, $a);
tidy_repair_file($s, $l, $l, $l);
tidy_repair_file($s, $s, $s, $s);
tidy_repair_file($l, $l, $l ,$l);
tidy_repair_file($a, $a, $a, $a);
echo "Done\n";
?>
--EXPECTF--
Warning: tidy_repair_string(): Could not load configuration file '1' in %s on line %d
Warning: tidy_repair_string(): Could not set encoding '1' in %s on line %d
Warning: tidy_repair_string(): Could not load configuration file '' in %s on line %d
Warning: tidy_repair_string(): Could not load configuration file '1' in %s on line %d
Warning: tidy_repair_string(): Could not set encoding '1' in %s on line %d
Warning: tidy_repair_string() expects parameter 1 to be string, array given in %s on line %d
Warning: tidy_repair_file(): Filename cannot be empty in %s on line %d
Warning: tidy_repair_file(): Filename cannot be empty in %s on line %d
Warning: tidy_repair_file() expects parameter 1 to be a valid path, array given in %s on line %d
Done

View file

@ -1,37 +0,0 @@
--TEST--
ZE2 A private method cannot be called in a derived class
--FILE--
<?php
class pass {
private function show() {
echo "Call show()\n";
}
public function do_show() {
$this->show();
}
}
class fail extends pass {
function do_show() {
$this->show();
}
}
$t = new pass();
$t->do_show();
$t2 = new fail();
$t2->do_show();
echo "Done\n"; // shouldn't be displayed
?>
--EXPECTF--
Call show()
Fatal error: Uncaught Error: Call to private method pass::show() from context 'fail' in %s:%d
Stack trace:
#0 %s(%d): fail->do_show()
#1 {main}
thrown in %s on line %d