move .php files to .inc in test/quick that aren't tests
Instead of having a blacklist on name, how about we use a different file extension for included files? Many PHP installs do this for files that are in the document root but shouldn't be served. @override-unit-failures
Esse commit está contido em:
@@ -6,6 +6,6 @@ function __autoload($cls) {
|
||||
echo "__autoload $cls\n";
|
||||
}
|
||||
|
||||
require "autoload5.php";
|
||||
require "autoload4.inc";
|
||||
|
||||
print "Test end\n";
|
||||
|
||||
@@ -1,94 +0,0 @@
|
||||
<?php
|
||||
|
||||
class Blah {
|
||||
public $x = "uncollected string";
|
||||
}
|
||||
|
||||
class Cycler {
|
||||
public function __destruct() { echo "Shouldn't run\n"; }
|
||||
|
||||
public $x = null;
|
||||
public $y;
|
||||
}
|
||||
|
||||
function test_cycles($what) {
|
||||
echo "-------------------" . $what . "---------------------------\n";
|
||||
$file = tempnam("/tmp", "cycles_unit_test");
|
||||
fb_gc_detect_cycles($file);
|
||||
echo @file_get_contents($file);
|
||||
@unlink($file);
|
||||
echo fb_gc_collect_cycles();
|
||||
}
|
||||
|
||||
function decl_prop_cycle() {
|
||||
global $x;
|
||||
$x = new Blah();
|
||||
|
||||
// y <---> x
|
||||
$y = new Cycler();
|
||||
$y->y = "this is a string";
|
||||
$y->x = new Cycler();
|
||||
$y->x->x = $y;
|
||||
|
||||
/*
|
||||
* y2 ---> y3 -----> array(Cycler())
|
||||
* ^ |
|
||||
* | |
|
||||
* +-- y4 <-+
|
||||
*/
|
||||
$y2 = new Cycler();
|
||||
$y3 = new Cycler();
|
||||
$y4 = new Cycler();
|
||||
$y2->x = $y3;
|
||||
$y3->x = $y4;
|
||||
$y4->x = $y2;
|
||||
$y3->y = array(new Cycler());
|
||||
}
|
||||
|
||||
decl_prop_cycle();
|
||||
test_cycles("decl");
|
||||
var_dump($x->x);
|
||||
|
||||
function dyn_prop_cycle() {
|
||||
$y = new Cycler();
|
||||
$y->d_y = "this is a string";
|
||||
$y->d_x = new Cycler();
|
||||
$y->d_x->d_x = $y;
|
||||
|
||||
// Same graph as decl_prop_cycle, but will have the dynprop array in
|
||||
// between everything.
|
||||
$y2 = new Cycler();
|
||||
$y3 = new Cycler();
|
||||
$y4 = new Cycler();
|
||||
$y2->d_x = $y3;
|
||||
$y3->d_x = $y4;
|
||||
$y4->d_x = $y2;
|
||||
$y3->d_y = array(new Cycler());
|
||||
}
|
||||
|
||||
dyn_prop_cycle();
|
||||
test_cycles("dyn");
|
||||
var_dump($x->x);
|
||||
|
||||
function array_cycle() {
|
||||
/*
|
||||
* array() ------------------> $x
|
||||
* ^ |
|
||||
* | |
|
||||
* | v
|
||||
* array() ---> array() ---> RefData
|
||||
* ^ |
|
||||
* | |
|
||||
* +--------------------------+
|
||||
*/
|
||||
$y = array();
|
||||
$x = new Cycler();
|
||||
$x->x =& $y;
|
||||
$y["one"]["bar"] = $x;
|
||||
$y["two"]["bar"] =& $y;
|
||||
$y["three"] = "string data";
|
||||
}
|
||||
|
||||
array_cycle();
|
||||
test_cycles("array");
|
||||
var_dump($x->x);
|
||||
@@ -1,16 +0,0 @@
|
||||
<?php
|
||||
|
||||
function main() {
|
||||
if(true) {
|
||||
for(; ;) {
|
||||
for(; ;) { }
|
||||
}
|
||||
} else {
|
||||
for(; ;) {
|
||||
for(; ;) { }
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
main();
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
<?php
|
||||
|
||||
function main() {
|
||||
for($i = 0; $i < 10;) {
|
||||
if(true) {
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
function foo() {
|
||||
require 'define_b.php';
|
||||
require 'define.inc';
|
||||
}
|
||||
|
||||
function main() {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
$doc = dirname(__FILE__) . '/_fbcufa_init.php';
|
||||
$doc = dirname(__FILE__) . '/fbcufa.inc';
|
||||
require_once $doc;
|
||||
function main() {
|
||||
global $doc;
|
||||
|
||||
@@ -3,19 +3,19 @@
|
||||
$a = 1;#"a\n";
|
||||
print $a."\n";
|
||||
|
||||
require 'include_b.php';
|
||||
require 'include.1.inc';
|
||||
|
||||
print $a."\n";
|
||||
print $b."\n";
|
||||
|
||||
function foo() {
|
||||
require 'include_c.php';
|
||||
require 'include.2.inc';
|
||||
}
|
||||
foo();
|
||||
|
||||
$path = dirname(__FILE__) . '/include_d.php';
|
||||
$path = dirname(__FILE__) . '/include.3.inc';
|
||||
require $path;
|
||||
|
||||
$path = __DIR__ . '/include_d.php';
|
||||
$path = __DIR__ . '/include.3.inc';
|
||||
require $path;
|
||||
|
||||
|
||||
@@ -5,14 +5,14 @@ $x = 12;
|
||||
$y = 34;
|
||||
@f();
|
||||
$z = 56;
|
||||
$t = include 'include2_a.php';
|
||||
$t = include 'include2.1.inc';
|
||||
var_dump($x);
|
||||
var_dump($y);
|
||||
var_dump($z);
|
||||
var_dump($t);
|
||||
$t = include_once 'include2_a.php';
|
||||
$t = include_once 'include2.1.inc';
|
||||
var_dump($t);
|
||||
$t = @include_once 'include_doesnt_exist.php';
|
||||
$t = @include_once 'include2_doesnt_exist.inc';
|
||||
var_dump($t);
|
||||
$t = include_once 'include2_b.php';
|
||||
$t = include_once 'include2.2.inc';
|
||||
var_dump($t);
|
||||
|
||||
@@ -5,7 +5,7 @@ class A {
|
||||
private $d;
|
||||
public function f() {
|
||||
eval('$this->a = 20; $this->c = 200;');
|
||||
include 'include3_a.php';
|
||||
include 'include3.inc';
|
||||
echo $this->a."\n";
|
||||
echo $this->b."\n";
|
||||
echo $this->c."\n";
|
||||
|
||||
@@ -1 +1 @@
|
||||
<?php include "include_backtrace2.php";
|
||||
<?php include "include_backtrace.inc";
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
<?php
|
||||
|
||||
for(; ;) {
|
||||
for(; ;) { }
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
require_once "redeclared_class1.php";
|
||||
require_once "redeclared_class2.php";
|
||||
require_once "redeclared_class.1.inc";
|
||||
require_once "redeclared_class.2.inc";
|
||||
|
||||
var_dump(X::V);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
require_once "redeclared_class2.php";
|
||||
require_once "redeclared_class1.php";
|
||||
require_once "redeclared_class.2.inc";
|
||||
require_once "redeclared_class.1.inc";
|
||||
|
||||
var_dump(X::V);
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
print "Test begin\n";
|
||||
|
||||
require_once 'ReqOnce_b.php';
|
||||
require_once 'reqonce2.inc';
|
||||
print "Between require_once invocations\n";
|
||||
require_once 'ReqOnce_b.php';
|
||||
require_once 'reqonce2.inc';
|
||||
|
||||
print "Test end\n";
|
||||
|
||||
Referência em uma Nova Issue
Bloquear um usuário